|
Hi Mattias, It looks to me like someone is doing work on the Connection under the JTA local transaction prior to trying to do work under a JTA global transaction with that connection. >From a spec. standpoint, pretty much any method that throws java.sql.SQLException by definition may touch the DB engine (and thus could conceivably drive transactional work). By JTA/JDBC rules, you must complete any work under the JTA local transaction (Connection.commit() or Connection.rollback()) before you attempt to start a JTA global transaction on tha connection. In this case, I see a call to Connection.getCatalog() Here's the trace record (timestamp 1003401891.939800, thread 0x9 in the trace) Jdbc: 1003401891.939800 00000009: > DB2Connection@-1830846606.getCatalog() Since the connection was created with a target of *LOCAL, in order to retrieve the catalog we need to go to the DB engine (by that query you see) from this tracerecord (timestamp 1003401892.605584, thread 0x9) in the trace. Jdbc: 1003401892.605584 00000009: < DB2Statement@-389614221.<init>( hDbc=3, hStmt=4 ) Jdbc: 1003401892.633088 00000009: > DB2Statement@-389614221.executeQuery(SELECT VARCHAR(DBXRDBN, 128) FROM QSYS.QADBXRDBD WHERE DBXRMTN='*LOCAL') This drives DB engine work (read only work). That work must be committed before you can start a new transaction. The XAResource.start() method then fails because there has been no call to Connection.commit() or Connection.rollback() prior to starting the new global transaction on the connection being used. (And there are no calls to commit or rollback between the getCatalog (timestamp 1003401891.939800 and the attempt to start the transaction at timestamp 1003402864.304920) I don't know enough about websphere or your application to know if you put the connection back into the connection pool and/or if websphere should be completing that work for you. But you could call Connection.commit() after you finish your previous work with the connection to see if that fixes your problem. Alternatively, you could use the real hostname in the datasource/getConnection call instead of *LOCAL or 'localhost' and we would probably not need to touch the DB engine. I wouldn't think this would be a great idea, because we touch the DB engine for other reasons. Websphere developers frequent newsgroup ibm.software.websphere.application-server.as400 on news.software.ibm.com. I know a lot of them but can't refer you to them by name here unless they would frequent this group. If you have troubles finding the place in your code doing this work, post this message on that forum. Good Luck. Here we see the XAResource.start() error here (at timestamp 1003402864.304920, thread 0x30). Jdbc: 1003402864.304920 00000030: > DB2StdXAResource@1025399867.start(): Xid={XID: formatId(113577), gtrid_length(26), bqual_length(25), data(0000017E 3614940B 5DFF587A C4918210 CB0953A6 129F50F8 132C0194 0B5DFF58 7AC49182 10CB0953 A6129F50 F8132C3B 5C1E3D)}, flags=0x00000000 Jdbc: 1003402864.381104 00000030: DB2XAResource.XAStart(): entry, hdbc=3, flags=0x00000000 Jdbc: 1003402864.381664 00000030: DB2XAResource.XAStart(): xid Jdbc: 1003402864.381664 00000030: 0001bba9 0000001a 00000019 0000017e Jdbc: 1003402864.381664 00000030: 3614940b 5dff587a c4918210 cb0953a6 Jdbc: 1003402864.381664 00000030: 129f50f8 132c0194 0b5dff58 7ac49182 Jdbc: 1003402864.381664 00000030: 10cb0953 a6129f50 f8132c3b 5c1e3d Jdbc: 1003402864.382744 00000030: DB2XAResource.XAStart(): A local transaction is pending on connection handle 3, rc=XAER_PROTO Jdbc: 1003402864.383056 00000030: Throwing: DB2XAException error -6 Jdbc: 1003402864.383352 00000030: JdbcStack: External Error Location Jdbc: 1003402864.608536 00000030: JdbcStack: Library / Program Module Stmt Procedure Jdbc: 1003402864.623568 00000030: JdbcStack: QSYS / QLESPI QLECRTTH 826 : LE_Create_Thread2__FP12crtth_parm_t Jdbc: 1003402864.671536 00000030: JdbcStack: Unknown / Unknown Unknown 0 : 46 Error Retrieving Stack Frame Information Jdbc: 1003402864.737480 00000030: JdbcStack: / JAVA400_JD GLUEMOD 0 : _UPCALL(_1) Jdbc: 1003402864.752552 00000030: JdbcStack: / JAVA400_JD DEMOD 11 : java-lang-Thread-run()V Jdbc: 1003402864.787080 00000030: JdbcStack: / LIB_SERVER DEMOD 104 : com-ibm-servlet-engine-oselistener-outofproc-OutOfProcThread$CtlRunnable-run()V Jdbc: 1003402864.811280 00000030: JdbcStack: / LIB_SERVER DEMOD 124 : com-ibm-servlet-engine-oselistener-serverqueue-SQWrapperEventSource$SelectRunnable-run()V Jdbc: 1003402864.811872 00000030: JdbcStack: / LIB_SERVER DEMOD 116 : com-ibm-servlet-engine-oselistener-serverqueue-SQWrapperEventSource$SelectRunnable-notifyService()V Jdbc: 1003402864.823224 00000030: JdbcStack: / LIB_SERVER DEMOD 40 : com-ibm-servlet-engine-oselistener-serverqueue-SQEventSource-notifyEvent(Lcom-ibm-servlet-engine-ose------ Jdbc: 1003402864.837840 00000030: JdbcStack: / LIB_SERVER DEMOD 184 : com-ibm-servlet-engine-oselistener-SQEventListenerImp-notifySQEvent(Lcom-ibm-servlet-engine-oseliste------ Jdbc: 1003402864.838504 00000030: JdbcStack: / LIB_SERVER DEMOD 155 : com-ibm-servlet-engine-oselistener-SQEventListenerImp$ServiceRunnable-run()V Jdbc: 1003402864.839048 00000030: JdbcStack: / LIB_SERVER DEMOD 95 : com-ibm-servlet-engine-oselistener-OSEListenerDispatcher-service(Lcom-ibm-servlet-engine-oselistener------ Jdbc: 1003402864.847136 00000030: JdbcStack: / LIB_SERVER DEMOD 867 : com-ibm-servlet-engine-srp-ServletRequestProcessor-dispatchByURI(Ljava-lang-String;Lcom-ibm-servlet------- Jdbc: 1003402864.867288 00000030: JdbcStack: / LIB_SERVER DEMOD 87 : com-ibm-servlet-engine-invocation-CacheableInvocationContext-invoke(Ljava-lang-Object;)V Jdbc: 1003402864.867920 00000030: JdbcStack: / LIB_SERVER DEMOD 25 : com-ibm-servlet-engine-invocation-CachedInvocation-handleInvocation(Ljava-lang-Object;)V Jdbc: 1003402864.887696 00000030: JdbcStack: / LIB_SERVER DEMOD 127 : com-ibm-servlet-engine-srt-WebAppInvoker-handleInvocationHook(Ljava-lang-Object;)V Jdbc: 1003402864.898592 00000030: JdbcStack: / LIB_SERVER DEMOD 105 : com-ibm-servlet-engine-webapp-WebAppRequestDispatcher-forward(Ljavax-servlet-ServletRequest;Ljavax-s------ Jdbc: 1003402864.899064 00000030: JdbcStack: / LIB_SERVER DEMOD 443 : com-ibm-servlet-engine-webapp-WebAppRequestDispatcher-dispatch(Ljavax-servlet-ServletRequest;Ljavax------- Jdbc: 1003402864.899728 00000030: JdbcStack: / LIB_SERVER DEMOD 771 : com-ibm-servlet-engine-webapp-WebAppRequestDispatcher-handleWebAppDispatch(Lcom-ibm-servlet-engine-w------ Jdbc: 1003402864.908168 00000030: JdbcStack: / LIB_SERVER DEMOD 186 : com-ibm-servlet-engine-webapp-ServletInstance-service(Ljavax-servlet-ServletRequest;Ljavax-servlet-S------ Jdbc: 1003402864.922808 00000030: JdbcStack: / LIB_SERVER DEMOD 46 : com-ibm-servlet-engine-webapp-StrictLifecycleServlet-_service(Ljavax-servlet-ServletRequest;Ljavax-s------ Jdbc: 1003402864.923560 00000030: JdbcStack: / LIB_SERVER DEMOD 21 : com-ibm-servlet-engine-webapp-StrictServletInstance-doService(Ljavax-servlet-ServletRequest;Ljavax-s------ Jdbc: 1003402864.962744 00000030: JdbcStack: / WEBASADV_L DEMOD 25 : javax-servlet-http-HttpServlet-service(Ljavax-servlet-ServletRequest;Ljavax-servlet-ServletResponse;------ Jdbc: 1003402864.963184 00000030: JdbcStack: / WEBASADV_L DEMOD 136 : javax-servlet-http-HttpServlet-service(Ljavax-servlet-http-HttpServletRequest;Ljavax-servlet-http-Ht------ Jdbc: 1003402864.983304 00000030: JdbcStack: / EJB__SEJZA GLUEMOD 0 : _UPCALL(_2) Jdbc: 1003402865.7632 00000030: JdbcStack: / WEBASADV_L GLUEMOD 0 : _UPCALL(_3)L Jdbc: 1003402865.32000 00000030: JdbcStack: / WEBASADV_L DEMOD 36 : com-ibm-ejs-container-EJSHome-postCreate(Lcom-ibm-ejs-container-BeanO;Ljava-lang-Object;)Ljavax-ejb------- Jdbc: 1003402865.32456 00000030: JdbcStack: / WEBASADV_L DEMOD 30 : com-ibm-ejs-container-ContainerManagedBeanO-postCreate()V Jdbc: 1003402865.67832 00000030: JdbcStack: / WEBASADV_L DEMOD 1 : com-ibm-ejs-persistence-EJSJDBCPersister-create(Ljavax-ejb-EntityBean;)V Jdbc: 1003402865.70160 00000030: JdbcStack: / WEBASADV_L GLUEMOD 0 : _UPCALL(_2)L Jdbc: 1003402865.70560 00000030: JdbcStack: / WEBASADV_L DEMOD 25 : com-ibm-ejs-persistence-EJSJDBCPersister-getPreparedStatement(Ljava-lang-String;)Ljava-sql-PreparedS------ Jdbc: 1003402865.88352 00000030: JdbcStack: / WEBASADV_L DEMOD 13 : com-ibm-ejs-cm-DataSourceImpl-getConnection(Ljava-lang-String;Ljava-lang-String;)Ljava-sql-Connectio------ Jdbc: 1003402865.107464 00000030: JdbcStack: / WEBASADV_L DEMOD 1 : com-ibm-ejs-cm-pool-ConnectionPool-getConnection(Ljava-lang-String;Ljava-lang-String;)Ljava-sql-Conn------ Jdbc: 1003402865.107904 00000030: JdbcStack: / WEBASADV_L DEMOD 99 : com-ibm-ejs-cm-pool-ConnectionPool-allocateConnection(Ljava-lang-String;Ljava-lang-String;Ljava-util------ Jdbc: 1003402865.108248 00000030: JdbcStack: / WEBASADV_L DEMOD 217 : com-ibm-ejs-cm-pool-ConnectionPool-findConnectionForTx(Lorg-omg-CosTransactions-Coordinator;Ljava-la------ Jdbc: 1003402865.112952 00000030: JdbcStack: / WEBASADV_L DEMOD 8 : com-ibm-ejs-cm-pool-ConnectionPool-allocateConnForTransaction(Lcom-ibm-ejs-cm-pool-ConnectO;Lorg-omg------ Jdbc: 1003402865.113544 00000030: JdbcStack: / WEBASADV_L DEMOD 89 : com-ibm-ejs-cm-pool-ConnectO-allocate(Lorg-omg-CosTransactions-Coordinator;I)Z Jdbc: 1003402865.114192 00000030: JdbcStack: / WEBASADV_L DEMOD 41 : com-ibm-ejs-cm-pool-JTAConnectO-enlist(Lorg-omg-CosTransactions-Coordinator;I)Z Jdbc: 1003402865.125336 00000030: JdbcStack: / WEBASADV_L DEMOD 81 : com-ibm-ejs-jts-jta-JTSXA-enlist(Ljavax-transaction-xa-XAResource;Ljavax-sql-XADataSource;ILjava-lan------ Jdbc: 1003402865.125776 00000030: JdbcStack: / WEBASADV_L DEMOD 171 : com-ibm-ejs-jts-jta-JTSXA-enlist(Ljavax-transaction-xa-XAResource;Ljava-lang-Class;Lcom-ibm-ejs-jts------- Jdbc: 1003402865.128088 00000030: JdbcStack: / WEBASADV_L DEMOD 542 : com-ibm-ejs-jts-jta-TransactionImpl-enlistResource(Ljavax-transaction-xa-XAResource;)Z Jdbc: 1003402865.143624 00000030: JdbcStack: / WEBASADV_L DEMOD 332 : com-ibm-ejs-jts-jta-XARminst-startAssociation(Lorg-omg-CosTransactions-Coordinator;Lcom-ibm-ejs-jts------- Jdbc: 1003402865.207528 00000030: JdbcStack: / EXT_QP_DB2 DEMOD 208 : com-ibm-db2-jdbc-app-DB2StdXAResource-start(Ljavax-transaction-xa-Xid;I)V Jdbc: 1003402865.211904 00000030: JdbcStack: / EXT_QP_DB2 GLUEMOD 0 : _MINATIVE(_VILI)V Jdbc: 1003402865.284976 00000030: JdbcStack: QJAVA / QJVAJDBCXA QJVAXRSC 1032 : Java_com_ibm_db2_jdbc_app_DB2XAResource_XAStart Jdbc: 1003402865.307024 00000030: JdbcStack: QJAVA / QJVAJDBCXA QJVAXUT 1017 : throwXAException__Fi Jdbc: 1003402865.386736 00000030: JdbcStack: QJAVA / QJVAJDBC QJVAXTR 1071 : JTRACESTACK Jdbc: 1003402865.387168 00000030: JdbcStack: QJAVA / QJVAJDBC QJVAXTR 1147 : JdbcDumpStack__Fv Jdbc: 1003402865.387496 00000030: JdbcStack: QJAVA / QJVAJDBC QJVAXTR 1158 : JdbcDumpTargetStack__Fi Jdbc: 1003402865.387752 00000030: JdbcStack: Completed In every single ethnic, religious or racial group, there are a very few truly evil people. For each of those people there are many, many, many good people. Assuming anything (evilness or capability for evil) about the particular group is bigotry and idiocy. Don't do it. -- Me Fred A. Kulack - AS/400e Java and Java DB2 access, Jdbc, JTA, etc... IBM in Rochester, MN (Phone: 507.253.5982 T/L 553-5982) mailto:kulack@us.ibm.com Personal: mailto:kulack@magnaspeed.net AOL Instant Messenger: Home:FKulack Work:FKulackWrk
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.