Problem using non-autocommit mode
Posted: 13.02.2007, 11:58
I've installed Zeos DBO 6.6.0 beta, connecting to MySQL 5.0.27, Delphi6 Professional. I have a following problem with ZConnection.AutoCommitMode:
When I set ZConnection.AutoCommit to False, then while calling TZConnection.StartTransaction it always raises an exception "Invalid operation in non AutoCommit mode".
I think there is a bug in TZConnection.CheckAutoCommitMode. There is a condition
if not FAutoCommit and (FExplicitTransactionCounter = 0) then
raise...
I guess that FExplicitTransactionCounter holds number of transactions that have been started programatically. So whe using non-autocommit mode it's impossible to call StartTransaction because FExplicitTransactionCounter is 0.
I changed then condition to:
if not FAutoCommit and (FExplicitTransactionCounter > 0) then
raise EZDatabaseError.Create(SInvalidOpInNonAutoCommit);
The exception is raised when some transaction is being used... It works properly in both autocommit and non-autocommit mode, but I'm not sure if I understood the meaning of FExplicitTransactionCounter correctly.
Does anyone have similar experience?
thanks
Jiri Matejka
When I set ZConnection.AutoCommit to False, then while calling TZConnection.StartTransaction it always raises an exception "Invalid operation in non AutoCommit mode".
I think there is a bug in TZConnection.CheckAutoCommitMode. There is a condition
if not FAutoCommit and (FExplicitTransactionCounter = 0) then
raise...
I guess that FExplicitTransactionCounter holds number of transactions that have been started programatically. So whe using non-autocommit mode it's impossible to call StartTransaction because FExplicitTransactionCounter is 0.
I changed then condition to:
if not FAutoCommit and (FExplicitTransactionCounter > 0) then
raise EZDatabaseError.Create(SInvalidOpInNonAutoCommit);
The exception is raised when some transaction is being used... It works properly in both autocommit and non-autocommit mode, but I'm not sure if I understood the meaning of FExplicitTransactionCounter correctly.
Does anyone have similar experience?
thanks
Jiri Matejka