Why StartTransaction?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
devmann
Posts: 4
Joined: Tue 21 Nov 2006 03:26

Why StartTransaction?

Post by devmann » Tue 21 Nov 2006 07:53

Hi,

I find that I can still successfully commit data to the database with the following codes even though I don't put a StartTransaction in the codes.
Why use StartTransaction?

Code: Select all

oraTable.ApplyUpdates;  // write data from memory to database
oraTable.Session.Commit;  // commit data
oraTable.CommitUpdates;  // clear cached memory
Is it because I'm in a client-server environment?

Then in what condition it is a must to use StartTransaction?

Thanx :D

dm

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Wed 22 Nov 2006 14:39

This is Oracle specific. It allows to call Commit even if there is no active transaction.

devmann
Posts: 4
Joined: Tue 21 Nov 2006 03:26

Does it mean ...

Post by devmann » Thu 23 Nov 2006 00:42

Thanx. Does it mean I don't have to StartTransaction before a Commit as told in the ODAC online help?

Thanx
dm
challenger wrote:This is Oracle specific. It allows to call Commit even if there is no active transaction.

Challenger
Devart Team
Posts: 925
Joined: Thu 17 Nov 2005 10:53

Post by Challenger » Fri 24 Nov 2006 14:52

No, this means that if you call the Commit method whithout call to the StartTransaction method you will not get error. But if you want to perform all the updates in a single transaction you should call StartTransaction before TOraTable.ApplyUpdates.

Post Reply