Return-Path: Delivered-To: apmail-geronimo-dev-archive@www.apache.org Received: (qmail 6146 invoked from network); 11 Aug 2010 16:50:42 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 11 Aug 2010 16:50:42 -0000 Received: (qmail 47652 invoked by uid 500); 11 Aug 2010 16:44:02 -0000 Delivered-To: apmail-geronimo-dev-archive@geronimo.apache.org Received: (qmail 47605 invoked by uid 500); 11 Aug 2010 16:44:01 -0000 Mailing-List: contact dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: dev@geronimo.apache.org List-Id: Delivered-To: mailing list dev@geronimo.apache.org Received: (qmail 47598 invoked by uid 99); 11 Aug 2010 16:44:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Aug 2010 16:44:01 +0000 X-ASF-Spam-Status: No, hits=2.2 required=10.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [98.136.44.63] (HELO smtp108.prem.mail.sp1.yahoo.com) (98.136.44.63) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 11 Aug 2010 16:43:52 +0000 Received: (qmail 20536 invoked from network); 11 Aug 2010 16:43:30 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=DKIM-Signature:Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:Mime-Version:Content-Type:Subject:Date:In-Reply-To:To:References:Message-Id:X-Mailer; b=Tg93LKsJhcEcKce/BKTjJaSmtAgBl0qdXCLfy3rqHFd/FPZJT5v26RH41I7ik8PsHdOPpsad1eRDyQjAsJVHLEspn46TTzlmi8M6Qu0PMtYXIarIeeyNjM0VQ+XMxnFzdxS+3+dwv4pBGqQ3lSUNneBp3TfU13NJqYposlAXwjM= ; DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1281545010; bh=9Oz3JCEG6/LYqbGTrGHhRIziytJDSg2rzIkLwbwsQY0=; h=Received:X-Yahoo-SMTP:X-YMail-OSG:X-Yahoo-Newman-Property:From:Mime-Version:Content-Type:Subject:Date:In-Reply-To:To:References:Message-Id:X-Mailer; b=nOtjIlmIPgREGgcB6srZkTcW77OfQC3c+x2ngapNa2oWk1xi2JqgnSW0GGV+guDSmDVb82hQUEiV3q3btNa4jGfgQ0evdWVYocvo/qHqqPcd123owmonkhwd23CpNWr5EGzjr8NFmaSeWQ3iM6OefD2y5IdW1JEbB1K3pfcYRuE= Received: from [10.0.1.3] (david_jencks@76.76.148.215 with plain) by smtp108.prem.mail.sp1.yahoo.com with SMTP; 11 Aug 2010 09:43:28 -0700 PDT X-Yahoo-SMTP: .9oIUzyswBANsYgUm_5uPui0skTnzGJXJQ-- X-YMail-OSG: BFVeWFoVM1kTC4oPDHoFwOfZ6xFgu5HFxmhQnFauyVNeQON B5vyUK8g25KzmUbdcQt2syRYCHZhtjW8L69wbjtqS7n2FnL_ZK6vO1vy_XUH IYWU0uZ2FJMG5UReN8h0SZJmxti4GDFwR1t1z2gLT5i9aTXJ.eaEKr2vUejM a5f9.tgh.VqfcecHKZ5vK47sKcvJprWK91k3BWwGE9Kyf5CHdb3oREiNPr3i 4nZKgdFbLvclUTlwPIalt0ICBDZbjzAmdHt45uUTE.HdF3YpiAEQ9vRSGpaA B60X6OIVYOjjxqET_GINLkmuGfd5ZRecJdZKa9zDrPDuD9ilevyjODN5w X-Yahoo-Newman-Property: ymail-3 From: David Jencks Mime-Version: 1.0 (Apple Message framework v1081) Content-Type: multipart/alternative; boundary=Apple-Mail-6-442613578 Subject: Re: XA_RBROLLBACK Exception when using Derby in transaction.roolback() Date: Wed, 11 Aug 2010 09:43:27 -0700 In-Reply-To: <201008112330048507126@gmail.com> To: dev@geronimo.apache.org References: <201008111514286873127@gmail.com> <201008112330048507126@gmail.com> Message-Id: <769E0D5F-7CA0-4FE9-9252-84DCAB081572@yahoo.com> X-Mailer: Apple Mail (2.1081) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-6-442613578 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 You should be able to use two datasources on one database. It's a bit = odd but we should be able to handle it. It's more plausible to get in = this situation with a jms provider where you have inbound and outbound = messaging, geronimo will treat the inbound XAResource and outbound = XAResource as different. It's possible that this is affected by whether what derby returns from = isSameRM. =20 I suspect this is from the second branch, derby is telling the tm that = the tx has already been rolled back from the first branch. It would be a lot easier to investigate this if you could provide a = complete exception stack trace. thanks! david jencks On Aug 11, 2010, at 8:30 AM, lilisacat wrote: > I use > DataSourceDefinition(name=3D"java:app/SHAcc") link to = url=3D"jdbc:derby://localhost:1527/SHAcc", > DataSourceDefinition(name=3D"java:app/BJAcc")link to another = url=3D"jdbc:derby://localhost:1527/BJAcc", > so they point to two different databases. > The transaction can commit correctly. > =20 > The problem appears when I call the transaction.setRollBackOnly() = method, transaction will rollback in fact, > but the server say:=20 > org.apache.derby.client.am.XaException: XA_RBROLLBACK : Error = executing a XAResource.end(), server returned XA_RBROLLBACK > =20 > 2010-08-11 > lilisacat > =E5=8F=91=E4=BB=B6=E4=BA=BA=EF=BC=9A sghayal > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4=EF=BC=9A 2010-08-11 21:03:11 > =E6=94=B6=E4=BB=B6=E4=BA=BA=EF=BC=9A dev > =E6=8A=84=E9=80=81=EF=BC=9A > =E4=B8=BB=E9=A2=98=EF=BC=9A Re: XA_RBROLLBACK Exception when using = Derby in transaction.roolback() > U r using wrong url. Both the url point to same database. >=20 > This is what seems to be happening. A single transaction has been = started which is being committed twice. >=20 > If using xa u need two physically different databases. >=20 > Hope this helps. >=20 > Cheers, >=20 > Sandip > Sent from my =E2=80=9Ccontract free=E2=80=9D BlackBerry=C2=AE = smartphone on the WIND network. >=20 > From: "lilisacat" > Date: Wed, 11 Aug 2010 15:15:41 +0800 > To: dev > ReplyTo: dev@geronimo.apache.org > Subject: XA_RBROLLBACK Exception when using Derby in = transaction.roolback() >=20 > Hi, > I encournter a problem when run the app in the G-3.0-SANPSHOT. > In the app, I used Datasource DS-A and Datasource DS-B to link two = derby database. > If UserTransaction.rollback() called, the server occured error: > org.apache.derby.client.am.XaException: XA_RBROLLBACK : Error = executing a XAResource.end(), server returned XA_RBROLLBACK. > =20 > Here is the details of two Datasource: > //DataSourceSH > @DataSourceDefinition(name=3D"java:app/SHAcc", > className=3D"org.apache.derby.jdbc.ClientXADataSource", > url=3D"jdbc:derby://localhost:1527/SHAcc", > user=3D"system", > databaseName=3D"SHAcc", > transactional=3Dtrue, > maxPoolSize=3D10, > properties =3D {"createDatabase =3D create"}) > //DataSourceBJ > @DataSourceDefinition(name=3D"java:app/BJAcc", > className=3D"org.apache.derby.jdbc.ClientXADataSource", > url=3D"jdbc:derby://localhost:1527/BJAcc", > user=3D"system", > databaseName=3D"BJAcc", > transactional=3Dtrue, > maxPoolSize=3D10, > properties =3D {"createDatabase =3D create"}) > =20 > In the Servlet, I used two datasources as following: > Context initContext =3D new InitialContext(); > tx =3D = (UserTransaction)initContext.lookup("java:comp/UserTransaction"); > // Start a transaction > // First, use DataSourceSH > ds =3D (javax.sql.DataSource) initContext.lookup("java:app/SHAcc"); > //get connection with database: SHAcc > //do some update on database: SHAcc > if(failFlag) > {tx.setRollBackOnly();} > // Second, use DataSourceBJ=20 > ds =3D (javax.sql.DataSource) initContext.lookup("java:app/BJAcc"); > //get connection with database: BJAcc > //do some update on database: BJAcc > // commit all the operations > tx.commit(); > } > catch(Exception e){ > if(tx!=3Dnull){ > try{ > // rollback the operations > tx.rollback(); > System.out.println("catch: roll back success.");} > catch(Exception e1){ > System.out.println("catch: roll back fail.");} > } > System.out.println("catch: " + e.getClass() + "; " + = e.getMessage()+""); > }...... > =20 > I have no idea why Error executing a XAResource.end() if = tx.rollback() happens? > =20 > Thanks ! > 2010-08-11 > Lisa --Apple-Mail-6-442613578 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 You should be able to use two datasources on one = database.  It's a bit odd but we should be able to handle it. =  It's more plausible to get in this situation with a jms provider = where you have inbound and outbound messaging, geronimo will treat the = inbound XAResource and outbound XAResource as = different.

It's possible that this is affected by = whether what derby returns from isSameRM. =  

I suspect this is from the second branch, = derby is telling the tm that the tx has already been rolled back from = the first branch.

It would be a lot easier to = investigate this if you could provide a complete exception stack = trace.

thanks!
david = jencks

On Aug 11, 2010, at 8:30 AM, lilisacat = wrote:

I = use
DataSourceDefinition(name=3D"java:app/SHAcc") link = to url=3D"jdbc:derby://localhost:1527/SHAcc",=
DataSourceDefinition(name=3D"java:app/BJAcc")link to = another url=3D"jdbc:derby://localhost:1527/BJAcc",
<= /font>
so they point to two = different databases.
    The transaction = can commit correctly.
 
    = The problem appears when I call the transaction.setRollBackOnly() = method, transaction will rollback in = fact,
but the = server say: 
org.apache.derby.client.am.= XaException: XA_RBROLLBACK : Error executing a&nb= sp;XAResource.end(), server returned XA_RBROLLBACK
 
2010-08-11

lilisacat

=E5=8F=91=E4=BB=B6=E4=BA=BA=EF=BC=9A sghayal
=E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4= =EF=BC=9A 2010-08-11  = 21:03:11
=E6=94=B6=E4=BB=B6=E4=BA=BA=EF=BC=9A dev
=E6=8A=84=E9=80=81=EF=BC=9A
=
=E4=B8=BB=E9=A2=98=EF=BC=9A=  Re: = XA_RBROLLBACK Exception when using Derby in = transaction.roolback()
U r = using wrong url. Both the url point to same database.

This is = what seems to be happening. A single transaction has been started which = is being committed twice.

If using xa u need two physically = different databases.

Hope this = helps.

Cheers,

Sandip

Sent from my =E2=80=9Ccontract = free=E2=80=9D BlackBerry=C2=AE smartphone on the WIND = network.



Here is the details of two = Datasource:
   maxPoolSize=3D10,

Lisa
=
= --Apple-Mail-6-442613578--