Posted By: holger.sachs Autocommit - 09/23/99 12:08 PM
Hi

in the 3.3.1 Version of DOA I get a message that the AutoCommit Property is obsolete and will be
removed in the next Version.


Im using this property for the following reason

Example:

A form to add some records into one ore more Tables , OK Button, Cancel Button

In the OnShow Event of the Form I set the

DoaDaten.DoaSession.AutoCommit :=FALSE;

Now the user can add some Records into the Tables Tables ...

If he presses the OK Button :

DoaDaten.DoaSession.Commit;

modalResult:=mrOK;

If he presses the cancel Button :

doaDaten.DoaSession.rollback;
modalResult:=mrCancel;


And finally, in the OnClose Event of the Form
DoaDaten.DoaSession.AutoCommit:=TRUE;


This is a easy and perfectly working way to implement the Cancel functionality

Can somebody tell me how to do this without the Autocommit Property .

When do the DOAs the commit ?
Maybe I dont understand the Autocommit Property, what does it mean if its "False" , do I have to commit ever by myself ?


Best regards
Holger
Posted By: Marco Kalter Re: Autocommit - 09/25/99 03:12 PM
In the example that you provided you can simply remove all references to AutoCommit. By default AutoCommit will be false, and in the next version there will not be any AutoCommit property. You have to explicitly manage your transactions through commits and rollbacks.

The only component that does any implicit transaction management is the TOracleDataSet. By default it will commit any posted or deleted record. If something goes wrong during this process, it will rollback any changes it made. If you are using CachedUpdates, posted and deleted records will not immediately be applied to the database, and will therefore not be committed or rolled back either. Now you must use TOracleSession.ApplyUpdates, CancelUpdates and CommitUpdates to manage the transaction.

For all other components that can modify the database (TOracleQuery, TOraclePackage, TLOBLocator and TOracleObject), you must also explicitly commit or rollback these modifications.


------------------
Marco Kalter
Allround Automations
© Allround Automations forums