473,549 Members | 2,597 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"Applicatio n 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:

"Applicatio n 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(574153 44), 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:
"Applicatio n 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 10751
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:

"Applicatio n 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(574153 44), 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
4810
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 change. Occasionally, it blows up with an Application Exception. It seems to only die at the customer site
6
1996
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 then I want to close the form unseen by the end user. Regards John baker
2
15470
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: encType="multipart/form-data" <INPUT id="UploadFile" type="file" name="UploadFile" runat="server"> Private Sub btnUploadFile_Click(ByVal sender As System.Object,...
2
2586
by: Mike | last post by:
Is there an equivalent in VB.Net or C# of VBScript's "Eval" and "Execute" statements? Thanks, Mike
13
5060
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 only 1 thread per line Trunk_Thread.ApartmentState = ApartmentState.STA
6
1531
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 string in vb.net
23
24501
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'; $dbh=DBI->connect("DBI:mysql:database=$database;host=$host","$usuario","$senha") or die "Can't open DB: $!";
5
11796
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 col1=:c1' into c2 using 'AAA'; end;
1
3730
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 presses a button to do a SQL query (fill a DataSet). Before firing the query, I disable the grid/buttons and turn on UseWaitCursor. After it...
0
7527
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7459
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
1
7485
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6052
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5377
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5097
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3488
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1064
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.