Good Morning!
I have an issue: PowerBuilder is calling the APD functions with an open transaction.
=> The APD functions are Stored Procedure(s). ( we can not have access to see how these SPs are coded )
=> Our PB application calls these APD SPs from our "limsapd" database and the DBA said: PowerBuilder is calling the APD functions with an open transaction. ( We have Rollback when sqlca.sqlcode = -1 ... DBA still said open transaction )
=> Our PB application is also calling a lot of other SPs from other databases but no issues
=> Will using the AutoCommit = true and set back to false fix the issue of opening transaction like below ?
sqlca.Autocommit = true
Declare apd_checkinout procedure for limsapd.dbo.CheckInOut
...
Execute apd_checkinout;
If sqlca.sqlcode = -1 then
set error message...
//Rollback using sqlca ; -> commented out because the autocommit is added .
End If
Close apd_checkinout;
sqlca.Autocommit = false
We are using PB2017 R3 and Microsoft SQL Server 2016.
How does the opening transaction happen ?
I really appreciate any help!
Thank you!
DBA said : Powerbuilder should not be controlling ANY database transactions as the transaction is a database function and those should be carried out entirely within the stored procedure being called. I would ask that we turn OFF the PB transaction for the APDirector procedure calls so that the stored procedure can be fully in control of the database transaction.
I think there are no actual problems ... I just dont get it the "open transaction" that the DBA mentioned...
I think he wants the PB issue SQL statements outside the scope of a transaction . I have updated to use AutoCommit true and false for these APD stored procedures .
Thanks again!
I think your DBA meant "Begin Transaction". Which PB always does on a Connect or Commit command on behalf of your application. So AutoCommit = FALSE means that your PB App is *not* issuing a Begin Trans.
Regards ... Chris
if ALL of your updates/deletes/inserts are done via stored procedures, then it makes sense to just change over to autocommit true so that PB doesn't start transactions. (true means don't start a transaction and false means start a transaction). read the help on autocommit and google some of this stuff.