There is no active transaction
There is no active transaction
Hi !
We are randomly getting "There is no active transaction". What can cause this problem ?
dbexpress for sql server, latest version.
Delphi 6.02
SQL Server 2008 32bit
Windows 2003 32bit
Any help greatly appreciated.
Thanks
Martin
We are randomly getting "There is no active transaction". What can cause this problem ?
dbexpress for sql server, latest version.
Delphi 6.02
SQL Server 2008 32bit
Windows 2003 32bit
Any help greatly appreciated.
Thanks
Martin
It's a 700K Lines Project and we cannot find any pattern when the errors occur so far.
I'm wondering where this error message is coming from, maybe you can help. Is it generated by the vcl layer, the driver, the sql server ?
Can this happen, when a connection is ungracefully closed/lost between the calls to StartTransaction and CommitTransaction ?
I'm wondering where this error message is coming from, maybe you can help. Is it generated by the vcl layer, the driver, the sql server ?
Can this happen, when a connection is ungracefully closed/lost between the calls to StartTransaction and CommitTransaction ?
After a lot of thinking, I guess I have found the source of the "There is no active transaction" problem
Here is some Pseudo Code to explain:
What happens ? According to Technet, SQL Server does implicitly rollback the active transaction when choosing the statement as deadlock victim. So when the exception handler is called, the transaction is already cancelled and rolled back in sql server, but the dbexpress driver is unaware of that. So the call to rollback the transaction fails with "There is no active transaction", beause the server does not have an active transaction anymore.
According to Technet, sql server returns error code 1205 when he chooses a statement as deadlock victim.
Is there something you could do to solve this problem on the driver level ?

Here is some Pseudo Code to explain:
Code: Select all
Begin Transaction
try
Exec SQL Code
Exec SQL Code
Exec SQL Code <------------- Deadlock in Server
Commit Transaction
except
on Exception do
begin
Rollback Transaction <------------- "There is no active transaction"
end
end
According to Technet, sql server returns error code 1205 when he chooses a statement as deadlock victim.
Is there something you could do to solve this problem on the driver level ?
To whom it may concern,
We are a paying customer of DevArt (formerly CoreLAb) since years and we are therefore expecting a certain level of support.
This is an urgent problem for us (as are the other two issues currenlty open see forum). We are using dbexpress drivers for real world applications not just for fun.
If DevArt is unable or unwilling to solve the problem, please drop a message saying that so we don't have to poll the forum every hour to see if you have kindly posted a solution or answer.
If there is another support channel that we should use, let us know.
Thanks
Martin
We are a paying customer of DevArt (formerly CoreLAb) since years and we are therefore expecting a certain level of support.
This is an urgent problem for us (as are the other two issues currenlty open see forum). We are using dbexpress drivers for real world applications not just for fun.
If DevArt is unable or unwilling to solve the problem, please drop a message saying that so we don't have to poll the forum every hour to see if you have kindly posted a solution or answer.
If there is another support channel that we should use, let us know.
Thanks
Martin