Page 1 of 1

odac 6.80.0.48 bcb 2009,changes NOT commited,AutoCommit True

Posted: Fri 25 Sep 2009 07:57
by albourgz
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????

Posted: Mon 28 Sep 2009 08:47
by Plash
You should set AutoCommit to True to ODAC commit changes.

it is set to true

Posted: Mon 28 Sep 2009 10:26
by albourgz
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)

Posted: Tue 29 Sep 2009 07:33
by Plash
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.