Autonomous Transactions

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ahijazi
Posts: 47
Joined: Mon 01 Oct 2007 11:13

Autonomous Transactions

Post by ahijazi » Wed 05 Jan 2011 16:10

Dear Devart;
How can I initiate more than one transaction in the same connection ?? as main transaction and others sub ones

Case :

Code: Select all

  snMain :TOraSession

  tblMain: TOraTable;
     session := snMain ;

  tblSub: TOraTable;
     session := snMain ;
tblMain call startTransaction and made some modifications, before commit or rollback, i need tblSub to be able start a transaction, then roll or commit it's own modification only; without affect tblMain modifications.

can i do that with one TOraSession component ???


work around: just create two TOraSession and set pooling True


Best Regards,

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Thu 06 Jan 2011 09:43

Hello,

Oracle doesn't allow working with more that one transaction in one session using standard methods, but you can execute a PL/SQL block or procedure in a separate transaction transaction by using the PRAGMA AUTONOMOUS_TRANSACTION directive.

Post Reply