odac 6.80.0.48 bcb 2009,changes NOT commited,AutoCommit True

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

odac 6.80.0.48 bcb 2009,changes NOT commited,AutoCommit True

Post by albourgz » Fri 25 Sep 2009 07:57

I have a datamodule and a form with a TOraSession, a TSmartQuery with as sql:

Code: Select all

select a.rowid, a.* from cec.myTable a
and CachedUpdates false, a TOraDataSource, a TCRDBGrid, and a TDBNavigator.
Autocommit is false in TOraSession, and true in TSmartQuery.
I have a button "commit" that makes:

Code: Select all

Orasession->ApplyUpdates();
When Opening form, I Open() The smartQuery.

In bcb 6, this program worked fine (with an older version of odac), and changes were commited as soon as ApplyUpdates() was executed.
In bcb2009, the changes are NOT commited when executing ApplyUpdates() and are commited ONLY when exiting application. :cry:

Any hint????

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

Post by Plash » Mon 28 Sep 2009 08:47

You should set AutoCommit to True to ODAC commit changes.

albourgz
Posts: 160
Joined: Wed 06 May 2009 12:17
Location: belgium

it is set to true

Post by albourgz » Mon 28 Sep 2009 10:26

AutoCommit is set to false at TOraSession level, and it is set to True at TSmartQuery level.
So it should work (TSmartQuery ovevrides the TOraSession level for the query according to doc, and it works in bcb6 and odac 5.55.1.26)

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

Post by Plash » Tue 29 Sep 2009 07:33

The AutoCommit property of TSmartQuery overrides the same property of TOraSession when TOraSession.AutoCommit = True and TSmartQuery.AutoCommit = False.

If TOraSession.AutoCommit = False, autocommit is always disabled, and TSmartQuery.AutoCommit is not used.

E. g. you can disable autocommit for all queries by setting TOraSession.AutoCommit to False, or disable autocommit just for one query by setting TOraSession.AutoCommit = True and TSmartQuery.AutoCommit = False.

Post Reply