Sessions Questions.

Shane

Member
Hi,

Can someone explain to me in english what happens inside a transaction, if you are creating and destroying TOracledatasets that are updating records on the fly.

Example

Session.Start;
try

for 1 := 1 to 1000 do
begin

CreateTOracledataset;
InsertRecord;
DestroyTOracledatasets;
end;

Session.Commit
except
Session.Rollback
end;

Will all these records created in the for loop be commited to the database, even though the TOracledataset that inserted them has been destroyed after each insert?

Thanks in advance.

Shane
 
By default: yes. Each posted record will be committed.

If however you set TOracleDataSet.CommitOnPost to False, these commits will not occur, and you can subsequently commit or rollback the transaction.
 
Originally posted by Marco Kalter:
By default: yes. Each posted record will be committed.

If however you set TOracleDataSet.CommitOnPost to False, these commits will not occur, and you can subsequently commit or rollback the transaction.
To make it slighly more clear - if CommitOnPost is set, then no single transactions exists - each insert will be transaction by itself.
 
Back
Top