Article

SQL Exception occurs in database transaction.;DB2 SQL error: SQLCODE: -911, SQLSTATE: 40001, SQLERRMC: 2

« Go Back

Information

 
Article Number000015384
EnvironmentProduct: Savvion
Version: 7.x
OS: All supported platforms
Other: DB2
Question/Problem Description
SQL Exception occurs in database transaction.; context(BLDAOService.handle(SQLEx))DB2 SQL error: SQLCODE: -911, SQLSTATE: 40001, SQLERRMC: 2

 
Steps to Reproduce
Clarifying Information
IBM DB2 is the backend database.
Error MessageXATransaction E J2CA0027E: An exception occurred while invoking rollback on an XA Resource Adapter
from dataSource jdbc/BizLogicDB, within transaction ID {XidImpl: formatId(57415344), gtrid_length(36), bqual_length(54),
data(0000012aed75f2ae0000000100001e51abf3fcdc9e630acd71b4680f95b8977dfa5672bc0000012aed75f2ae0000000100001e51abf3fcdc9e630acd71b4680f95b8977dfa5672bc000000010000000000000000000000000001)}:
com.ibm.db2.jcc.b.di: XAER_NOTA : [ibm][db2][jcc][t4][2041][11392] Error executing XAResource.end(). Server returned XA_RBDEADLOCK. :
[ibm][db2][jcc][t4][2041][11392] Error executing XAResource.rollback(). Server returned XAER_NOTA.
Defect/Enhancement Number
Cause
The classic deadlock situation arises when two (or more) sessions are waiting to acquire a lock on a shared resource, and none of them can proceed because a second session also has a lock on some other resource that is required by the first session. Imagine a situation, in which Session 1 holds resource A, while trying to access resource B; at the same time Session 2 holds resource B while trying to access resource A. 
Usually RDBMS resolves situations like this automatically by killing one of the processes and rolling back all the changes it may have made.

IBM DB2 runs a background process, called Deadlock Detector, to find and resolve the deadlock situation. The session chosen as a deadlock victim is rolled back, and a special error is generated (SQLCODE-901, SQLSTATE 40001). The read-only process is a prime candidate for the deadlock
victim, and beyond that, DB2 employs "least cost" criteria to select the session to be killed.

The particular use case where this error was encountered is not available.
Resolution
Consult DBA to verify if there were any DB connectivity / execution failure occurred.
Review application for potential deadlock scenarios, and implement solutions to avoid them.
Use system monitoring tools to collect information about the deadlock situations and either optimize the system.
 
Workaround
Notes
Some external links that might be useful:

Finding the needle in the Deadlock haystack
Attachment 
Last Modified Date9/13/2015 3:47 AM
Disclaimer

The origins of the information on this site may be internal or external to Progress Software Corporation (“Progress”). Progress Software Corporation makes all reasonable efforts to verify this information. However, the information provided is for your information only. Progress Software Corporation makes no explicit or implied claims to the validity of this information.

Any sample code provided on this site is not supported under any Progress support program or service. The sample code is provided on an "AS IS" basis. Progress makes no warranties, express or implied, and disclaims all implied warranties including, without limitation, the implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample code is borne by the user. In no event shall Progress, its employees, or anyone else involved in the creation, production, or delivery of the code be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample code, even if Progress has been advised of the possibility of such damages.



Feedback
 
Was this article helpful?

   

Your feedback is appreciated.

Please tell us how we can make this article more useful. Please provide us a way to contact you, should we need clarification on the feedback provided or if you need further assistance.

Characters Remaining: 1025