Nizam Muhammed
Nizam Muhammed

Reputation: 21

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();?

Upvotes: 1

Views: 2030

Answers (2)

Surie
Surie

Reputation: 31

settransobject() tells the Sql connection details to Datawindow, so that on retrieve & update it uses specified sql connection using the transaction object. Build in transaction object is SQLCA . configure its attributes for db connection.

Autocommit: if set to true, will not require commit statement to put after sql statements in code. If set to false, will require commit statement. this is done so as to encourage use of transaction rollback if error and commit if no errors occur .Autocommit is a attribute of SQLCA transaction object.

Upvotes: 0

Matt Balent
Matt Balent

Reputation: 2397

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.

Upvotes: 1

Related Questions