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? 2 10687
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
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. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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:...
|
by: Mike |
last post by:
Is there an equivalent in VB.Net or C# of VBScript's "Eval" and "Execute"
statements?
Thanks,
Mike
|
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...
|
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...
|
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';
...
|
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...
|
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...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM).
In this month's session, the creator of the excellent VBE...
|
by: MeoLessi9 |
last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
|
by: DolphinDB |
last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation.
Take...
|
by: Aftab Ahmad |
last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below.
Dim IE As Object
Set IE =...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: marcoviolo |
last post by:
Dear all,
I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
| |