472,370 Members | 2,417 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,370 software developers and data experts.

"Application must execute a rollback."

We're encountering a situation where we're encountering a deadlock, and
someone's been made the deadlock victim. But after that, DB2 refuses to run
any SQL, and instead we get the error message:

"Application must execute a rollback. The unit of work has already been
rolled back in the database but other resource managers involved in this
unit of work might not. To ensure integrity of this application, all SQL
requests will be rejected until the application issues a rollback."

What's odd is that we do issue a rollback, but DB2 then throws an error
saying that there is no transaction in progress. So the question is: If we
must issue a rollback, but when we do we get a warning, how do we issue a
rollback without issuing a rollback.
Here's the detailed pseudo-code sequence of events:

Start a transaction
try {
Open a connection to the database
try {
Execute an INSERT statement
}
catch {
Caught the following exception:
DB2 SQL error: SQLCODE: -911, SQLSTATE: 40001, SQLERRMC: 68

Execute a ROLLBACK; which triggered another exception:

"An exception occurred while invoking rollback on an XA Resource
Adapter from dataSource jdbc/OLGCSURV, within transaction ID {XID:
formatId(57415344), gtrid_length(29), bqual_length(25), data(00000001
E0280D0D 145270CB 48E5DF26 D2DCFB89 374466CC F99E946C F9015270 CB48E5DF
26D2DCFB 89374466 CCF99E94 6CF9BAE4 0073)}: com.ibm.db2.jcc.a.bh: XAER_NOTA"

}
}
finally {
Before closing the connection to the database, run a stored procedure to
do some required cleanup. This triggered another exception:
"Application must execute a rollback. The unit of work has already been
rolled back in the database but other resource managers involved in this
unit of work might not. To ensure integrity of this application, all SQL
requests will be rejected until the application issues a rollback. "

}
Why are we getting an error when we issue the required rollback. And how do
we issue a rollback without issuing a rollback? What can we do differently?
How can we break the database connection out of the state where it thinks
the application needs to execute a rollback?
Mar 13 '07 #1
2 10390
Ian Boyd wrote:
We're encountering a situation where we're encountering a deadlock, and
someone's been made the deadlock victim. But after that, DB2 refuses to
run any SQL, and instead we get the error message:

"Application must execute a rollback. The unit of work has already
been
rolled back in the database but other resource managers involved in this
unit of work might not. To ensure integrity of this application, all SQL
requests will be rejected until the application issues a rollback."

What's odd is that we do issue a rollback, but DB2 then throws an error
saying that there is no transaction in progress. So the question is: If
we must issue a rollback, but when we do we get a warning, how do we issue
a rollback without issuing a rollback.
That sounds as if your are using XA/Xopen or type 2 connections? If so, you
will have to make sure that your TP monitor rolls back the distributed
transaction and starts a new one. With XA/Xopen, you'd have to issue an
xa_start call to all transaction participants (DB2 in your case).
Adapter from dataSource jdbc/OLGCSURV, within transaction ID {XID:
formatId(57415344), gtrid_length(29), bqual_length(25), data(00000001
E0280D0D 145270CB 48E5DF26 D2DCFB89 374466CC F99E946C F9015270 CB48E5DF
26D2DCFB 89374466 CCF99E94 6CF9BAE4 0073)}: com.ibm.db2.jcc.a.bh:
XAER_NOTA"
The "XAER" will only occur with distributed transactions. So check your TPM
logic (see above).
Why are we getting an error when we issue the required rollback.
A single transaction participant rolled back its transaction (part).
Therefore, the TPM has to take care that _all_ other participants roll back
their transaction. Once that is done, you can start a new transaction.
Regular XA processing stuff...
And how
do we issue a rollback without issuing a rollback? What can we do
differently? How can we break the database connection out of the state
where it thinks the application needs to execute a rollback?
Fix your application/TPM.

--
Knut Stolze
DB2 z/OS Admin Enablement
IBM Germany
Mar 13 '07 #2
It's fair to say that i have no idea what most of what you said means. We
use an object-relational mapping object persistance framework called
"Hibernate" do all the database interaction. We don't do anything special
with distributed transactions.

Unfortunatly, when Hibernate is told to connect to Websphere, all this
maddness happens. If Hibernate is pointed directly at a simpler Tomcat
server, this doesn't happen.

We had no choice but to use Hibernate.
We had no choice but to use Websphere.
We had no choice but to use JNDI.
We had no choice but to use DB2.
The problem is not specific to DB2, but a subtle and impossible to diagnose
symptom of the interaction between the above four components. Unfortunatly,
the only thing we can do to "rollback" our tranasction is call "rollback",
which generates the error from Websphere; there's nothing more we can do.

So it's not DB2's fault, and no longer a question for a db2 newsgroup.

Thank you for your insights.


Mar 19 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: gregory_may | last post by:
I have an application I created called "JpegViewer.exe". It simply loads a Jpeg file and displays in on the screen. It works great, in my lab. When I am using it at a customer site, things...
6
by: John Baker | last post by:
Hi: Does "On Open" code execute before or after related data is loaded? I want to test before the form appears on the screen to see if there is any data in the queryresult, and if there is not...
2
by: CVerma | last post by:
I'm using an html input control (System.web.UI.HTMLControls.HTMLInputFile) to upload files such as msword, excel, jpg, and pdf. I have the encType property set in the form:...
2
by: Mike | last post by:
Is there an equivalent in VB.Net or C# of VBScript's "Eval" and "Execute" statements? Thanks, Mike
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
6
by: TJS | last post by:
in vbscript there was a command called "execute" which would process a dynamic string, vb.net dropped that feature ... does anybody have a working solution for sale or free that will execute a...
23
by: ticfranca | last post by:
Hi, I'm getting this error in the code below: sub Pega_recorde { $database = 'bundinha'; $host = 'localhost'; $usuario = 'myhumoradm'; $senha = 'my8xr2d2'; ...
5
by: stmfc | last post by:
i dont know why pl/sql block below returns no data found error. do you have any idea about it? declare c1 varchar2(80); c2 varchar2(80); begin execute immediate 'select col2 from table1 where...
1
by: Aegixx | last post by:
Ok, extremely wierd situation here: (I'll post the code below, after the explanation) I've got a Windows application (.NET 3.5) that has a single Form with a DataGridView embedded. The user...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Rahul1995seven | last post by:
Introduction: In the realm of programming languages, Python has emerged as a powerhouse. With its simplicity, versatility, and robustness, Python has gained popularity among beginners and experts...
1
by: ezappsrUS | last post by:
Hi, I wonder if someone knows where I am going wrong below. I have a continuous form and two labels where only one would be visible depending on the checkbox being checked or not. Below is the...
0
by: jack2019x | last post by:
hello, Is there code or static lib for hook swapchain present? I wanna hook dxgi swapchain present for dx11 and dx9.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.