Return-Path: Delivered-To: apmail-geronimo-user-archive@www.apache.org Received: (qmail 91789 invoked from network); 30 Dec 2009 09:15:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 30 Dec 2009 09:15:03 -0000 Received: (qmail 89227 invoked by uid 500); 30 Dec 2009 09:15:02 -0000 Delivered-To: apmail-geronimo-user-archive@geronimo.apache.org Received: (qmail 89165 invoked by uid 500); 30 Dec 2009 09:15:02 -0000 Mailing-List: contact user-help@geronimo.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: user@geronimo.apache.org List-Id: Delivered-To: mailing list user@geronimo.apache.org Received: (qmail 89157 invoked by uid 99); 30 Dec 2009 09:15:02 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 30 Dec 2009 09:15:02 +0000 X-ASF-Spam-Status: No, hits=-0.8 required=5.0 tests=AWL,BAYES_00,MISSING_MID X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [211.99.232.114] (HELO tongtech.com) (211.99.232.114) by apache.org (qpsmtpd/0.29) with SMTP; Wed, 30 Dec 2009 09:14:54 +0000 Received: from IBM0618 (unknown [124.42.76.2]) by tongtech.com with CMailServer 5.3 SMTP; Wed, 30 Dec 2009 17:14:28 +0800 From: "xuhongbo" To: Subject: Re: Reply: Cannot using Geronimo to execute bean-managed transaction with oracle transaction more than once, but Glassfish does Date: Wed, 30 Dec 2009 17:14:32 +0800 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook, Build 11.0.5510 In-reply-to: <5e7fd1eb0912291944h4bab1bf2q4ca52f31a9328ef9@mail.gmail.com> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 Thread-Index: AcqJAoPwNPq3WMIpT8OFj9qOR4cbXgAJf+Ww Message-Id: <20091230091501.E9AEF47849F@athena.apache.org> Hi Jack Cai: I have tried, the "tranql-connector-oracle-local" is ok, but it = doesn=92t use xa transaction in jta, and use a faked Local-XAResource instead of real oracle-xa-resource; I am sorry to mis-understand your means and give the run-time class = name in my previous reply; The error occurred program is just using " tranql-connector-oracle-xa" Additionally, I have try another Mysql database and using " tranql-connector-mysql-xa" do real xa transaction. It works well.=20 So my mind changed, maybe there is something not compatible with oracle = 9i database; In my original mail, I have post a very simple program which = use the Geronimo Transaction Manager and Oracle XA API directly, this works well;=20 Because tranql resource adaptor is a very simple wrapper , Geronimo does additional things to wrap the database connection (etc control pooling, xa-resource wrap, xa-resource cache for transaction-manager ...) , so I = am wondering if there is some other un-excepted database operation has been done and cause this problem? for convenience I post the simple program again.=20 =20 If we only concern database operation, does this simple program done exactly like the Geronimo done ? Or it doesn't , Geronimo do additional things... maybe the difference will be the real reason cause the = problem; I have tracked at runtime, but unfortunately has not find some = difference yet... Thanks a lot=20 xuhongbo -----origin----- sender: Jack Cai [mailto:greensight@gmail.com]=20 date: 2009/12/30 11:45 receiver: user@geronimo.apache.org subject: Re: Reply: Cannot using Geronimo to execute bean-managed transaction with oracle transaction more than once, but Glassfish does Can you try to use the tranql-connector-oracle-xa or tranql-connector-oracle-local to do the test? -Jack On Wed, Dec 30, 2009 at 11:26 AM, xuhongbo wrote: > >>>In the future it would be great if you could only post to one mailing >>>list. > Thanks, I know > >>>I'm not sure what is wrong yet, however you should never try to set >>>the autocommit state of a connection that is enlisted in a jta >>>transaction. =A0Enlisting and delisting the XAConnection will result = in >>>the autocommit being dealt with properly. =A0The value from >>>getAutoCommit may or may not be meaningful in a jta transaction. >>>Outside a jta transaction the autocommit state defaults to true. = =A0I'm >>>quite surprised you didn't get a more informative error. > > Yes you are right, auto commit has no means for jta connection and = cannot be > set to true; here I just set auto commit to false, so a jta connection > should just omit it; > But the surprise thing is if I doesn't affect auto commit state(in the > program, just comment the statement "setAutocommit(false)"), when = execute > database operation, =A0a "ORA-02089: COMMIT ..." exception =A0will be = throwed by > oracle's database driver; it looks like the Geronimo does a wrong = things > "commit on the connection when execute database operation"; and this should > only occurs on non-jta connection, because only no-jta connection will = set > auto commit default to true. > >>>One important piece of information that I don't see is which tranql >>>wrapper you used to deploy your datasource. > > The datasource =A0is org.tranql.connector.jdbc.DataSource. And it use = =A0a =A0a > managed-connection factory " org.tranql.connector.oracle.XAMCF" to = open > connection; And the managed-connection factory use a oracle's xa datasource > (oracle.jdbc.xa.client.OracleXADataSource); > > By the way , I haven't ever post a trivial problem I have meet when I deploy > the Oracle-XA data source. The trivial thing is: I must change the = deploy > plan created by Geronimo's web manage console tools, =A0 delete the = empty > property "TNSEntryName" and manually deploy it; because this is the oracle9i > database driver's question --- "a empty string value(not a null value) = set > to TNSEntryName" will cause oracle9i's database driver to omit the = other > property (etc serverName, serviceName ...) and cannot establish a = connect ; > I thinks this should have no means to the transaction commit failure; = but > maybe it would give some other useful things help to find out the = reason. > > Thanks a lot > xuhongbo > > -----origin ----- > sender: David Jencks [mailto:david_jencks@yahoo.com] > date: 2009/12/30 1:43 > receiver: user@geronimo.apache.org > subject: Re: Reply: Cannot using Geronimo to execute bean-managed > transaction with oracle transaction more than once, but Glassfish does > > In the future it would be great if you could only post to one mailing > list. > > I'm not sure what is wrong yet, however you should never try to set > the autocommit state of a connection that is enlisted in a jta > transaction. =A0Enlisting and delisting the XAConnection will result = in > the autocommit being dealt with properly. =A0The value from > getAutoCommit may or may not be meaningful in a jta transaction. > Outside a jta transaction the autocommit state defaults to true. = =A0I'm > quite surprised you didn't get a more informative error. > > One important piece of information that I don't see is which tranql > wrapper you used to deploy your datasource. > > thanks > david jencks > > On Dec 29, 2009, at 3:48 AM, xuhongbo wrote: > >> Hi: >> =A0 =A0 =A0 Yet I haven't find the real reason , I have noticed = another thing >> about the problem; >> =A0 =A0 =A0 =A0The original test program will throw exception while = transaction >> commit; but if =A0I comment the statement >> "connection.setAutoCommit(false); ". >> the exception will throws while execute prepare statement; and >> exception >> changed as "ORA-02089: COMMIT doesn't allowed in sub transaction" >> which >> raised by oracle's driver; >> =A0 =A0 =A0 It seems the connection 's auto commit is default set to = true; so I >> am wondering while secondly execute the trasaction , a no- >> transaction data >> source (not a transactional-datasource) is returned? >> >> -----origin----- >> Sender: xuhongbo [mailto:xuhb@tongtech.com] >> Date: 2009/12/29 12:53 >> Receiver: dev@geronimo.apache.org >> CC: user@geronimo.apache.org >> Subject: Cannot using Geronimo to execute bean-managed transaction >> with >> oracle transaction more than once, but Glassfish does >> >> Hi: >> =A0 =A0 =A0 When I using bean =A0managed transaction with oracle-xa , = I found that >> it cannot execute more than once; the first time, things is right and >> database is update; but if execute once again a oracle- xa-warning >> and a >> Geronimo exception occurs; the warning and exception is list at the >> end of >> this mail; >> >> =A0 =A0 =A0 The Geronimo Version I used is 2.1.4; and oracle version = is 9i; >> >> =A0 =A0 =A0 I have use another app-server GlassFish test the same = program, and >> it works well; My test program is list in the attachments: >> MyStatelessSessionBean.java is the ejb, and MyServlet is a servlet >> call the >> ejb; >> >> =A0 =A0 =A0 The oracle xa datasource 's plan is also list in = attachments; I am >> not sure about if I miss configured the datasource some-where; but = The >> datasource does works: I can test it and execute a query through the >> Geronimo's console; >> >> =A0 =A0 =A0 Although the oracle 's version is older, but I doesn't = thinks the >> database is not compatible with Geronimo's XA process; To ensure >> this, I >> write a simple test case =A0which use the Geronimo's Transaction >> Manager and >> Oralce's XA API directly; the simple test case works well; The >> simple test >> case is also list in the list; >> =A0 =A0 =A0 =A0In the simple test case I doesn't use the = UserTransaction but >> direct use the Geronimo's TransactionManager, because when debugging >> the >> my-application, I found the UserTransaction is provided by OpenEJB, >> and it >> just wrap the Geronimo's Transaction Manager; >> >> =A0 =A0 =A0 Finally , I guess if the tranql provided XADatasource is = not >> compatible with my application. So I try the following calling >> sequence, but >> they both occurs same problem; >> =A0 =A0 =A0 1:open-connection-->begin-trans-->do-update--> end-trans->close-conn >> =A0 =A0 =A0 2:begin-trans-->open-connection-->do-update-->end-trans->close-conn; >> =A0 =A0 =A0 = 3:begin-trans->open-connection-->do-update-->close-conn->end-trans; >> >> =A0 =A0 =A0 Now I have no idea about this problem, so I hope if = anyone can >> help-me to check this problem >> =A0 =A0 =A0 Thanks for any-suggestion; >> =3D >> =3D >> =3D >> =3D >> =3D >> = =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> Orcla XA Warning is: >> 009-12-25 19:39:00,500 WARN =A0[Transaction] Unable to enlist = XAResource >> org >> .apache.geronimo.transaction.manager.WrapperNamedXAResource@1e7dc51, >> errorCode: -3 >> oracle.jdbc.xa.OracleXAException >> =A0 =A0 =A0 at >> = oracle.jdbc.xa.OracleXAResource.checkError(OracleXAResource.java:1157) >> =A0 =A0 =A0 at >> oracle.jdbc.xa.client.OracleXAResource.start(OracleXAResource.java: >> 295) >> =A0 =A0 =A0 at >> org >> .apache >> .geronimo.transaction.manager.WrapperNamedXAResource.start(Wrapper >> NamedXAResource.java:86) >> =A0 =A0 =A0 at >> org >> .apache >> .geronimo.transaction.manager.TransactionImpl.enlistResource(Trans >> actionImpl.java:209) >> =A0 =A0 =A0 at >> org >> .apache >> .geronimo.connector.outbound.TransactionEnlistingInterceptor.getCo >> nnection(TransactionEnlistingInterceptor.java:54) >> =A0 =A0 =A0 at >> org >> .apache >> .geronimo.connector.outbound.TransactionCachingInterceptor.getConn >> ection(TransactionCachingInterceptor.java:87) >> =A0 =A0 =A0 at >> org >> .apache >> .geronimo.connector.outbound.ConnectionHandleInterceptor.getConnec >> tion(ConnectionHandleInterceptor.java:43) >> =A0 =A0 =A0 ....... >> =A0 =A0 =A0 at java.lang.Thread.run(Unknown Source) >> >> Geronimo Exception is: >> javax.transaction.RollbackException: Unable to commit: transaction >> marked >> for rollback >> =A0 =A0 =A0 at >> org >> .apache >> .geronimo.transaction.manager.TransactionImpl.rollbackResourcesDur >> ingCommit(TransactionImpl.java:671) >> =A0 =A0 =A0 at >> org >> .apache >> .geronimo.transaction.manager.TransactionImpl.commit(TransactionIm >> pl.java:270) >> =A0 =A0 =A0 at >> org >> .apache >> .geronimo.transaction.manager.TransactionManagerImpl.commit(Transa >> ctionManagerImpl.java:250) >> =A0 =A0 =A0 at >> org >> .apache >> .openejb.core.CoreUserTransaction.commit(CoreUserTransaction.java: >> 62) >> =A0 =A0 =A0 at >> org.apache.openejb.core.BaseContext >> $UserTransactionWrapper.commit(BaseContex >> t.java:194) >> =A0 =A0 =A0 at >> sampleear >> .MyStatelessSessionBean.sayHello(MyStatelessSessionBean.java:40) >> =A0 =A0 =A0 ...... >> =A0 =A0 =A0 at java.lang.Thread.run(Unknown Source) >> >> >> >> >> >> > > > >