powerbuilder

Autocommit and SetTransObject() in PowerBuilder


What are Autocommit and SetTransObject() in PowerBuilder? Is there any relation between them? Why is SQL Server non-Autocommit mode and Oracle is in Autocommit mode? How are the values for Autocommit processed?

What is the function of SetTransObject();?


Solution

  • SetTransObject is a datawindow method to establish a connection between itself and a database transaction object (the global trans object is SQLCA). Generally datawindows are 'connected' to the trans object soon after instantiation.

    Autocommit is a connection parameter used in establishing a connection by the transaction object (SQLCA) to the database. This parameter controls whether PowerBuilder issues SQL statements inside or outside the scope of a transaction.

    If the value is true the datawindow issues SQL statements outside the scope of a transaction. A COMMIT is issued after every successful SQL statement.

    If the value is false the datawindow issues SQL statements inside a transaction. A BEGIN TRANSACTION statement is issued when the connection is started and also after every COMMIT or ROLLBACK statement.