Print Thread
Autocommit
#71 09/23/99 12:08 PM
Joined: Sep 1999
Posts: 11
H
Member
OP Offline
Member
H
Joined: Sep 1999
Posts: 11
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

Re: Autocommit
#72 09/25/99 03:12 PM
Joined: Aug 1999
Posts: 22,214
Member
Offline
Member
Joined: Aug 1999
Posts: 22,214
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


Marco Kalter
Allround Automations

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.021s Queries: 14 (0.005s) Memory: 2.4982 MB (Peak: 3.0393 MB) Data Comp: Off Server Time: 2024-05-10 04:22:34 UTC
Valid HTML 5 and Valid CSS