Transactions

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
MarkusG
Posts: 4
Joined: Mon 18 Aug 2008 14:55

Transactions

Post by MarkusG » Tue 14 Oct 2008 10:40

Hi Forum.

im trying to use transactions with the oraComponents.
This is my way to implement it:

Code: Select all

OraSession.AutoCommit := False;
OraSession.StartTransaction(ilReadCommited, '', 'Test1');
// Table 'TEST' is empty => OK
OraQuery.SQL.Text := 'INSERT INTO test(id) values (1)';
OraQuery.AutoCommit := FALSE;
// Table 'TEST' is still empty => OK
OraQuery.ExecSql;
// Table 'TEST' is still empty => OK
OraSession.Commit;
// Table 'TEST' is still empty => NOT OK
After closing the app, all Data is correctly commited.
So, it could depend on the destruction of the Session.

The Session is in DirectMode

ODAC 6.50.0.36 for RAD Studio 2007
Oracle 9.2.0.5.0

Thanks for any ideas.

Regards
Markus

MarkusG
Posts: 4
Joined: Mon 18 Aug 2008 14:55

Post by MarkusG » Wed 15 Oct 2008 06:46

Hi Forum again,

the problem is solved!
My student has a local and a global instance of session with the same name.
So he wondered, why the global session wont work as expected.

We just kicked the local sessions and everything works fine.

Regards,

Markus

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 15 Oct 2008 11:37

You should set the Session property of the TOraQuery component to the appropriate session if you have several TOraSession components in your program.

Post Reply