[*Please note that the behavior of the MSSQL SQL Links driver v4.01 and
above has been changed to automatically reset the transaction state if a
1205 error is encountered]
Problem:
Some MS SQL Server operations cause the server to rollback the
current transaction. If this occurs within an explicit transaction,
the BDE transaction state is no longer in sync with the server.
A database.rollback or commit will cause a SQL Error:
'No user transaction is currently in progress. The rollback transaction
request has no corresponding BEGIN TRANSACTION.'
At this point the server has returned the server error code:
'1205' which is raised by the BDE.
The BDE will in turn raise the error:
'10255 : A deadlock was detected.'
A database.startTransaction will cause the BDE error,
'A user transaction is already in progress.'
Resolution:3 possible workarounds.
1) Set DB/ALIAS SQL PASSTHRU MODE param to "NOT SHARED"
2) Close and re-open the database that is out of sync.
3) execute a tquery that starts a transaction on the server and
then issue a database.rollback (?).
try database1.startTransaction;
//do something that causes a server error
except
//Check to see if the error caused the transaction to rollback on the
//server.
//If yes, start a transaction on the server.
//qBeginTrans SQL String = if @@TranCount=0 begin transaction
qBeginTrans.execSQL; //Rollback BDE and server transaction.
database1.rollback;
end;
죄송함다 우연히 돌아당기다
질문한 문구가 나오길레 올렸음다.
영어가 짧아서 걍 올렸음다.