X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 5EB769DCAE1 for ; Wed, 7 Dec 2005 09:50:17 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42274-08 for ; Wed, 7 Dec 2005 09:50:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from mail.digitalfairway.ca (ns.digitalfairway.ca [207.164.133.170]) by postgresql.org (Postfix) with ESMTP id D23479DCABF for ; Wed, 7 Dec 2005 09:50:14 -0400 (AST) Received: from toronto.toronto.digitalfairway.ca (unknown [192.168.100.10]) by mail.digitalfairway.ca (Postfix) with ESMTP id CEF96A0635 for ; Wed, 7 Dec 2005 08:50:15 -0500 (EST) Received: from localhost (toronto.toronto.digitalfairway.ca [127.0.0.1]) by toronto.toronto.digitalfairway.ca (Postfix) with ESMTP id 66DB6B7ADF for ; Wed, 7 Dec 2005 08:50:15 -0500 (EST) Received: from toronto.toronto.digitalfairway.ca ([127.0.0.1]) by localhost (toronto.toronto.digitalfairway.ca [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 09239-10 for ; Wed, 7 Dec 2005 08:50:15 -0500 (EST) Received: from [192.168.100.50] (unknown [192.168.100.50]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by toronto.toronto.digitalfairway.ca (Postfix) with ESMTP id 42F39B7ADE for ; Wed, 7 Dec 2005 08:50:15 -0500 (EST) From: Jan de Visser To: pgsql-jdbc@postgresql.org Subject: Re: pgsql XA with weblogic 8.1? User-Agent: KMail/1.8.3 References: <200511281217.39287.jdevisser@digitalfairway.com> <200511281506.39492.jdevisser@digitalfairway.com> In-Reply-To: MIME-Version: 1.0 X-UID: 1389 Date: Wed, 7 Dec 2005 08:50:11 -0500 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Message-Id: <200512070850.12250.jdevisser@digitalfairway.com> X-Virus-Scanned: amavisd-new at digitalfairway.ca X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0 required=5 tests=[none] X-Spam-Score: 0 X-Spam-Level: X-Archive-Number: 200512/39 X-Sequence-Number: 14370 Well, it seems that the list doesn't like attachments. So here again with m= y=20 log in-line... On Tuesday 29 November 2005 00:50, Kris Jurka wrote: > On Mon, 28 Nov 2005, Jan de Visser wrote: > > Well, that wasn't it. I debugged a bit, and it turns out that WL sends a > > start(xid,TMJOIN) when committing entity EJBs. Don't ask me why (I'm not > > an XA expert by any stretch of the imagination). What I did is took the > > pragmatic approach, and allow a TMJOIN if the connection is in > > STATE_ENDED and if the xid is the same as the current xid. This seems to > > work. > > What's the order of calls made? > > start(xid, TMNOFLAGS) > end(xid, TMSUCCESS) > start(xid, TMJOIN) > prepare(xid) > commit(xid, false) > > or does the start call only happen once, with TMJOIN instead of TMNOFLAGS. > It's tough to get an idea of what calls are actually being made and on > which connections. Any chance you could send us a log trace using > Oliver's new logging code in 8.2dev with loglevel=3D2? > > Kris Jurka I hacked BaseDataSource to allow for a LogLevel attribute, and PGXAConnecti= on=20 to print the flags passed to start, and got the attached. So it seems to be the case that the tx is started with TMNOFLAGS, ended, an= d=20 restarted with TMJOIN in the ejbStore phase (The 'Creating' message is=20 actually in ejbCreate()), which confirms my theory. So my question again: Would it be OK to allow TMJOIN on an ended but=20 non-committed tx with the same Xid? Like so: // Check implementation deficiency preconditions if (flags =3D=3D TMRESUME) throw new PGXAException(GT.tr("suspend/resume and join not implemented"), XAException.XAER_RMERR); if ( ( flags =3D=3D TMJOIN ) && ( ( state !=3D STATE_ENDED ) ||=20 !xid.equals( currentXid ) ) ) { throw new PGXAException(GT.tr("Transaction interleaving not implemented"), XAException.XAER_RMERR); } if ( ( state =3D=3D STATE_ENDED ) && ( !xid.equals( currentXid ) ||=20 ( flags !=3D TMJOIN ) ) ) { throw new PGXAException(GT.tr("Transaction interleaving not implemented"), XAException.XAER_RMERR); } As I mentioned before, this works for me. JdV!! Log: 08:47:41.442 (1) XAResource 1d12d43: starting transaction xid =3D=20 BEA1-000426CF2CA2CC69504A-6466632E636F7265 with flags TMNOFLAGS 08:47:41.444 (1) simple execute,=20 handler=3Dorg.postgresql.jdbc2.AbstractJdbc2Statement$StatementResultHandle= r@17b285e,=20 maxRows=3D0, fetchSize=3D0, flags=3D1 08:47:41.445 (1) FE=3D> Bind(stmt=3DS_1,portal=3Dnull) 08:47:41.445 (1) FE=3D> Execute(portal=3Dnull,limit=3D0) 08:47:41.445 (1) FE=3D> Parse(stmt=3Dnull,query=3D"SELECT id FROM=20 tableSerializedXML WHERE enttype=3D$1 AND id=3D$2",oids=3D{1043,1043}) 08:47:41.445 (1) FE=3D> Bind(stmt=3Dnull,portal=3Dnull,$1=3D, $2=3D) 08:47:41.446 (1) FE=3D> Describe(portal=3Dnull) 08:47:41.446 (1) FE=3D> Execute(portal=3Dnull,limit=3D0) 08:47:41.446 (1) FE=3D> Sync 08:47:41.447 (1) <=3DBE BindComplete [null] 08:47:41.447 (1) <=3DBE CommandStatus(BEGIN) 08:47:41.447 (1) <=3DBE ParseComplete [null] 08:47:41.447 (1) <=3DBE BindComplete [null] 08:47:41.447 (1) <=3DBE RowDescription(1) 08:47:41.447 (1) <=3DBE CommandStatus(SELECT) 08:47:41.448 (1) <=3DBE ReadyForQuery(T) [07 084741.449]:LOW:9597-ExecuteThrea:XMLEntity_9v:Type controlpaneldef, ID= =20 eos Creating 08:47:41.455 (1) XAResource 1d12d43: ending transaction xid =3D=20 BEA1-000426CF2CA2CC69504A-6466632E636F7265 [07 084741.457]:DET:9597-ExecuteThrea:XMLEntity_9v:Type controlpaneldef, ID= =20 eos ejbStore Type controlpaneldef, ID eoss-controlpanel [07 084741.458]:LOW:9597-ExecuteThrea:XMLEntity_9v:Type controlpaneldef, ID= =20 eos Storing 08:47:41.586 (1) XAResource 1d12d43: starting transaction xid =3D=20 BEA1-000426CF2CA2CC69504A-6466632E636F7265 with flags TMJOIN 08:47:41.589 (1) simple execute,=20 handler=3Dorg.postgresql.jdbc2.AbstractJdbc2Connection$TransactionCommandHa= ndler@40bc88,=20 maxRows=3D0, fetchSize=3D0, flags=3D22 08:47:41.590 (1) FE=3D> Parse(stmt=3DS_3,query=3D"ROLLBACK",oids=3D{}) 08:47:41.590 (1) FE=3D> Bind(stmt=3DS_3,portal=3Dnull) 08:47:41.590 (1) FE=3D> Execute(portal=3Dnull,limit=3D1) 08:47:41.591 (1) FE=3D> Sync 08:47:41.591 (1) <=3DBE ParseComplete [S_3] 08:47:41.592 (1) <=3DBE BindComplete [null] 08:47:41.592 (1) <=3DBE CommandStatus(ROLLBACK) 08:47:41.592 (1) <=3DBE ReadyForQuery(I) SQLException: SQLState() vendor code(-3) java.sql.SQLException: XA error: XAER_RMERR : A resource manager error has= =20 occured in the transaction branch start() failed on resource 'dfc.core':=20 XAER_RMERR : A resource manager error has occured in the transaction branch org.postgresql.xa.PGXAException: suspend/resume and join not implemented at org.postgresql.xa.PGXAConnection.start(PGXAConnection.java:118) at=20 weblogic.jdbc.wrapper.VendorXAResource.start(VendorXAResource.java:50) at weblogic.jdbc.jta.DataSource.start(DataSource.java:629) at=20 weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceIn= fo.java:1140) at=20 weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResource= Info.java:1072) at=20 weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceI= nfo.java:255) at=20 weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTr= ansactionImpl.java:463) at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1392) at=20 weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1334) at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:396) at weblogic.jdbc.jta.DataSource.connect(DataSource.java:354) at=20 weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.jav= a:305) at=20 dfc.util.database.J2EEConnectionFactory.createConnection(J2EEConnectionFact= ory.java:57) =2D-=20 =2D------------------------------------------------------------- Jan de Visser =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 jdevisser@digitalfair= way.com =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 Baruk Khazad! Khazad ai-menu! =2D-------------------------------------------------------------