If the commit statement is executed after Transaction.autocommit = true, PowerServer will display the error: Database connection or transaction is not opened, commit is invalid. To avoid this error, do not execute commit/rollback after Transaction.autocommit = true; or set the "TransactionException" property to false in the compiled Web APIs > AppConfig folder > Applications.json to suppress the error message.
If the commit statement is executed after the select statement, PowerServer will display an error indicating that the database connection failed due to the unknown logic error. To avoid the error, remove the commit statement after the select statement.