Re: [JBoss-user] XATxConnectionManager with Oracle?
Hi Igor- Could you tell me which files were added/modified in the patch, because we're having some real problems getting the cvs version to run, and we really need the xa transactions? Thanks - Original Message - From: Igor Fedorenko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 17, 2002 3:51 PM Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? David, I checked Branch_3_0 and it seemed to work. I completely agree that XidFactory is more elegant and flexible solution then hardcoded change to XidImpl. One suggestion though -- I would add comment about XidFactory mbean and its Pad attribute into sample oracle-xa-services.xml, otherwise it is not obvious how to configure this thing and invalid transaction id exception thrown during conn.close() does not add clarity ;-) David Jencks wrote: Many many thanks. I checked in the config file and applied the XAManagedConnection patch. Instead of applying the changes to Xid handling I changed Xid creation to be done through a factory mbean. You can configure the factory with the pad boolean property to specify if the xid's are of maximum size. In jboss 3, this mbean config is in the main jboss-service.xml file. In 3.1 it will be in a separate tm-service.xml file. Can you please check whether or not my reinterpretation of the patches still works? If so I will clean up the XidFactory interface a bit and port the changes to 3.1 as well. Thanks! david jencks On 2002.06.14 17:03:56 -0400 Igor Fedorenko wrote: Attached, please fine a patch which fixes problems with Oracle XA driver I have described earlier and example configuration file. The patch is against JBoss_3_0_0 cvs tag (branch?). Hope this helps. PS: sorry for html posting -Original Message- From: Igor Fedorenko [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 4:06 PM To: '[EMAIL PROTECTED]' Subject: RE: [JBoss-user] XATxConnectionManager with Oracle? Thanks for a helpful hint, David. As you correctly guessed my test ssb was leaking sql connections. I'll post my patch and config files here shortly. -Original Message- From: David Jencks [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 2:01 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? Thanks for your work on this. Please post the results when you are satisfied. IMO the entire xa wrapper needs replacing which I unfortunately won't have time for soon. I'm not sure if associateConnection can be implemented easily. You can avoid it being called if you always close connection handles before calling other ejb methods (through home or remote interfaces) (and do not hold connections over method boundaries). So, try this: Connection c = myds.getConnection(); //do something c.close() myotherRemoteInterface.doSomethingElse(); c = myds.getConnection(); //do the rest of your work c.close(); david jencks On 2002.06.14 13:35:16 -0400 Igor Fedorenko wrote: I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far 1. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes xaRes not enlisted. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else. 2. Although oracle xa driver accepts non-oracle Xid object, it seems to require that both getGlobalTransactionId and getBranchQualifier always return byte[64], otherwise it throws invalid transaction id during XAResource.end. Fixed XidImpl to return such arrays, not sure if it will work with all resource managers. !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=iso-8859-1 META NAME=Generator CONTENT=MS Exchange Server version 5.5.2654.45 TITLERE: [JBoss-user] XATxConnectionManager with Oracle?/TITLE /HEAD BODY PFONT SIZE=2Attached, please fine a patch which fixes problems with Oracle XA driver I have described earlier and example configuration file. The patch is against JBoss_3_0_0 cvs tag (branch?). Hope this helps./FONT/P PFONT SIZE=2PS: sorry for html posting/FONT /P PFONT SIZE=2-Original Message-/FONT BRFONT SIZE=2From: Igor Fedorenko [A HREF=mailto:[EMAIL PROTECTED];mailto:ifedorenko@thinkdynamics .com/A]/FONT BRFONT SIZE=2Sent: Friday, June 14, 2002 4:06 PM/FONT BRFONT SIZE=2To: '[EMAIL PROTECTED]'/FONT BRFONT SIZE=2Subject: RE: [JBoss-user] XATxConnectionManager with Oracle?/FONT /P BR PFONT SIZE=2Thanks for a helpful hint, David. As you correctly guessed my test ssb
Re: [JBoss-user] XATxConnectionManager with Oracle?
rm server/src/main/org/jboss/tm/TransactionManagerServiceMBean.java rm server/src/main/org/jboss/jms/asf/ServerSessionPoolLoaderMBean.java Mconnector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnection.java M server/build.xml M server/src/etc/conf/default/jboss-service.xml M server/src/etc/deploy/jms-service.xml M server/src/main/org/jboss/jms/asf/ServerSessionPoolFactory.java M server/src/main/org/jboss/jms/asf/ServerSessionPoolLoader.java M server/src/main/org/jboss/jms/asf/StdServerSession.java M server/src/main/org/jboss/jms/asf/StdServerSessionPool.java M server/src/main/org/jboss/jms/asf/StdServerSessionPoolFactory.java M server/src/main/org/jboss/tm/GlobalId.java M server/src/main/org/jboss/tm/TransactionImpl.java M server/src/main/org/jboss/tm/TransactionManagerService.java M server/src/main/org/jboss/tm/TxCapsule.java M server/src/main/org/jboss/tm/TxManager.java M server/src/main/org/jboss/tm/XidImpl.java I think thats everything david jencks On 2002.06.18 15:35:21 -0400 Tim wrote: Hi Igor- Could you tell me which files were added/modified in the patch, because we're having some real problems getting the cvs version to run, and we really need the xa transactions? Thanks - Original Message - From: Igor Fedorenko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 17, 2002 3:51 PM Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? David, I checked Branch_3_0 and it seemed to work. I completely agree that XidFactory is more elegant and flexible solution then hardcoded change to XidImpl. One suggestion though -- I would add comment about XidFactory mbean and its Pad attribute into sample oracle-xa-services.xml, otherwise it is not obvious how to configure this thing and invalid transaction id exception thrown during conn.close() does not add clarity ;-) David Jencks wrote: Many many thanks. I checked in the config file and applied the XAManagedConnection patch. Instead of applying the changes to Xid handling I changed Xid creation to be done through a factory mbean. You can configure the factory with the pad boolean property to specify if the xid's are of maximum size. In jboss 3, this mbean config is in the main jboss-service.xml file. In 3.1 it will be in a separate tm-service.xml file. Can you please check whether or not my reinterpretation of the patches still works? If so I will clean up the XidFactory interface a bit and port the changes to 3.1 as well. Thanks! david jencks On 2002.06.14 17:03:56 -0400 Igor Fedorenko wrote: Attached, please fine a patch which fixes problems with Oracle XA driver I have described earlier and example configuration file. The patch is against JBoss_3_0_0 cvs tag (branch?). Hope this helps. PS: sorry for html posting -Original Message- From: Igor Fedorenko [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 4:06 PM To: '[EMAIL PROTECTED]' Subject: RE: [JBoss-user] XATxConnectionManager with Oracle? Thanks for a helpful hint, David. As you correctly guessed my test ssb was leaking sql connections. I'll post my patch and config files here shortly. -Original Message- From: David Jencks [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 2:01 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? Thanks for your work on this. Please post the results when you are satisfied. IMO the entire xa wrapper needs replacing which I unfortunately won't have time for soon. I'm not sure if associateConnection can be implemented easily. You can avoid it being called if you always close connection handles before calling other ejb methods (through home or remote interfaces) (and do not hold connections over method boundaries). So, try this: Connection c = myds.getConnection(); //do something c.close() myotherRemoteInterface.doSomethingElse(); c = myds.getConnection(); //do the rest of your work c.close(); david jencks On 2002.06.14 13:35:16 -0400 Igor Fedorenko wrote: I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far 1. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes xaRes not enlisted. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else. 2. Although oracle xa driver accepts non-oracle Xid object, it seems to require that both getGlobalTransactionId and getBranchQualifier always
Re: [JBoss-user] XATxConnectionManager with Oracle?
Tim, Basically, I did two things (see attached diff) 1. In connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnection.java I added caching of XAResource 2. In server/src/main/org/jboss/tm/XidImpl.java I changed getGlobalTransactionId() and getBranchQualifier() to always return 64-byte arrays. Devid reinterpreted this change slightly, he added xid factory which can be configured to create correct xids (I mean, correct from oracle's point of view). You should be able to apply the diff to JBoss_3_0_0 (cvs -z3 co -rJBoss_3_0_0) which I assume corresponds to jboss 3.0. Btw, what are these real problems you are talking about? Are they related to setting oracle xa driver or Branch_3_0 has some other issues? Tim wrote: Hi Igor- Could you tell me which files were added/modified in the patch, because we're having some real problems getting the cvs version to run, and we really need the xa transactions? Thanks - Original Message - From: Igor Fedorenko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 17, 2002 3:51 PM Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? David, I checked Branch_3_0 and it seemed to work. I completely agree that XidFactory is more elegant and flexible solution then hardcoded change to XidImpl. One suggestion though -- I would add comment about XidFactory mbean and its Pad attribute into sample oracle-xa-services.xml, otherwise it is not obvious how to configure this thing and invalid transaction id exception thrown during conn.close() does not add clarity ;-) David Jencks wrote: Many many thanks. I checked in the config file and applied the XAManagedConnection patch. Instead of applying the changes to Xid handling I changed Xid creation to be done through a factory mbean. You can configure the factory with the pad boolean property to specify if the xid's are of maximum size. In jboss 3, this mbean config is in the main jboss-service.xml file. In 3.1 it will be in a separate tm-service.xml file. Can you please check whether or not my reinterpretation of the patches still works? If so I will clean up the XidFactory interface a bit and port the changes to 3.1 as well. Thanks! david jencks On 2002.06.14 17:03:56 -0400 Igor Fedorenko wrote: Attached, please fine a patch which fixes problems with Oracle XA driver I have described earlier and example configuration file. The patch is against JBoss_3_0_0 cvs tag (branch?). Hope this helps. PS: sorry for html posting -Original Message- From: Igor Fedorenko [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 4:06 PM To: '[EMAIL PROTECTED]' Subject: RE: [JBoss-user] XATxConnectionManager with Oracle? Thanks for a helpful hint, David. As you correctly guessed my test ssb was leaking sql connections. I'll post my patch and config files here shortly. -Original Message- From: David Jencks [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 2:01 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? Thanks for your work on this. Please post the results when you are satisfied. IMO the entire xa wrapper needs replacing which I unfortunately won't have time for soon. I'm not sure if associateConnection can be implemented easily. You can avoid it being called if you always close connection handles before calling other ejb methods (through home or remote interfaces) (and do not hold connections over method boundaries). So, try this: Connection c = myds.getConnection(); //do something c.close() myotherRemoteInterface.doSomethingElse(); c = myds.getConnection(); //do the rest of your work c.close(); david jencks On 2002.06.14 13:35:16 -0400 Igor Fedorenko wrote: I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far 1. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes xaRes not enlisted. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else. 2. Although oracle xa driver accepts non-oracle Xid object, it seems to require that both getGlobalTransactionId and getBranchQualifier always return byte[64], otherwise it throws invalid transaction id during XAResource.end. Fixed XidImpl to return such arrays, not sure if it will work with all resource managers. !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=iso-8859-1 META NAME=Generator CONTENT=MS Exchange Server version 5.5.2654.45 TITLERE: [JBoss-user] XATxConnectionManager with Oracle?/TITLE /HEAD BODY PFONT SIZE=2Attached, please fine a patch which fixes problems
Re: [JBoss-user] XATxConnectionManager with Oracle?
Thanks for that. Basically I checked out the 3_0_0 branch, and built it, and couldn't even get my non xa application (which works on 3.0.0 final release) working - I was getting NoSuchMethodErrors from the ear deployer. I guess I was doing something wrong and it was late and I was in a rush so I'd thought it might just be easier to patch the files directly onto our working codebase, hence the question. I shall try again tomorrow with a clearer head and see if I get the same effect - Original Message - From: Igor Fedorenko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 18, 2002 9:18 PM Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? Tim, Basically, I did two things (see attached diff) 1. In connector/src/main/org/jboss/resource/adapter/jdbc/xa/XAManagedConnection.ja va I added caching of XAResource 2. In server/src/main/org/jboss/tm/XidImpl.java I changed getGlobalTransactionId() and getBranchQualifier() to always return 64-byte arrays. Devid reinterpreted this change slightly, he added xid factory which can be configured to create correct xids (I mean, correct from oracle's point of view). You should be able to apply the diff to JBoss_3_0_0 (cvs -z3 co -rJBoss_3_0_0) which I assume corresponds to jboss 3.0. Btw, what are these real problems you are talking about? Are they related to setting oracle xa driver or Branch_3_0 has some other issues? Tim wrote: Hi Igor- Could you tell me which files were added/modified in the patch, because we're having some real problems getting the cvs version to run, and we really need the xa transactions? Thanks - Original Message - From: Igor Fedorenko [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, June 17, 2002 3:51 PM Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? David, I checked Branch_3_0 and it seemed to work. I completely agree that XidFactory is more elegant and flexible solution then hardcoded change to XidImpl. One suggestion though -- I would add comment about XidFactory mbean and its Pad attribute into sample oracle-xa-services.xml, otherwise it is not obvious how to configure this thing and invalid transaction id exception thrown during conn.close() does not add clarity ;-) David Jencks wrote: Many many thanks. I checked in the config file and applied the XAManagedConnection patch. Instead of applying the changes to Xid handling I changed Xid creation to be done through a factory mbean. You can configure the factory with the pad boolean property to specify if the xid's are of maximum size. In jboss 3, this mbean config is in the main jboss-service.xml file. In 3.1 it will be in a separate tm-service.xml file. Can you please check whether or not my reinterpretation of the patches still works? If so I will clean up the XidFactory interface a bit and port the changes to 3.1 as well. Thanks! david jencks On 2002.06.14 17:03:56 -0400 Igor Fedorenko wrote: Attached, please fine a patch which fixes problems with Oracle XA driver I have described earlier and example configuration file. The patch is against JBoss_3_0_0 cvs tag (branch?). Hope this helps. PS: sorry for html posting -Original Message- From: Igor Fedorenko [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 4:06 PM To: '[EMAIL PROTECTED]' Subject: RE: [JBoss-user] XATxConnectionManager with Oracle? Thanks for a helpful hint, David. As you correctly guessed my test ssb was leaking sql connections. I'll post my patch and config files here shortly. -Original Message- From: David Jencks [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 2:01 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? Thanks for your work on this. Please post the results when you are satisfied. IMO the entire xa wrapper needs replacing which I unfortunately won't have time for soon. I'm not sure if associateConnection can be implemented easily. You can avoid it being called if you always close connection handles before calling other ejb methods (through home or remote interfaces) (and do not hold connections over method boundaries). So, try this: Connection c = myds.getConnection(); //do something c.close() myotherRemoteInterface.doSomethingElse(); c = myds.getConnection(); //do the rest of your work c.close(); david jencks On 2002.06.14 13:35:16 -0400 Igor Fedorenko wrote: I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far 1. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section
[JBoss-user] XATxConnectionManager with Oracle?
I'm trying to get XA transactions to work in JBoss 3.0.0 with Oracle 9i. I've tried the oracle-service.xml provided with JBoss in docs/examples/jca (which uses LocalTxConnectionManager), and it works fine. I modified it to make an oracle-xa-service.xml (attached), using XATxConnectionManager, and I'm testing it with a little MBean service (attached). I can get a DataSource, get a Connection from it, and do a SELECT, but when my service calls Connection.close(), I get the following exception: java.lang.IllegalArgumentException: xaRes not enlisted at org.jboss.tm.TxCapsule.delistResource(TxCapsule.java:546) (Full stack trace attached.) Can anyone tell me what I'm doing wrong? Ben OracleTest.java Description: Binary data OracleTestMBean.java Description: Binary data java.lang.IllegalArgumentException: xaRes not enlisted at org.jboss.tm.TxCapsule.delistResource(TxCapsule.java:546) at org.jboss.tm.TransactionImpl.delistResource(TransactionImpl.java:93) at org.jboss.resource.connectionmanager.XATxConnectionManager$XAConnectionEventListener.delist(XATxConnectionManager.java:284) at org.jboss.resource.connectionmanager.XATxConnectionManager$XAConnectionEventListener.connectionClosed(XATxConnectionManager.java:329) at org.jboss.resource.adapter.jdbc.BaseManagedConnection.fireConnectionEvent(BaseManagedConnection.java:152) at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection.fireConnectionEvent(XAManagedConnection.java:203) at org.jboss.resource.adapter.jdbc.xa.XAManagedConnection$1.connectionClosed(XAManagedConnection.java:115) at oracle.jdbc.pool.OraclePooledConnection.callListener(OraclePooledConnection.java:482) at oracle.jdbc.pool.OraclePooledConnection.logicalClose(OraclePooledConnection.java:445) at oracle.jdbc.driver.OracleConnection.logicalClose(OracleConnection.java:2900) at oracle.jdbc.driver.OracleConnection.close(OracleConnection.java:1418) at txtest.OracleTest.startService(OracleTest.java:36) at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162) at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491) at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:894) at $Proxy6.start(Unknown Source) at org.jboss.system.ServiceController.start(ServiceController.java:340) at org.jboss.system.ServiceController.start(ServiceController.java:358) at org.jboss.system.ServiceController.start(ServiceController.java:358) at org.jboss.system.ServiceController.start(ServiceController.java:358) at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491) at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174) at $Proxy5.start(Unknown Source) at org.jboss.resource.RARDeployer.start(RARDeployer.java:212) at org.jboss.deployment.MainDeployer.start(MainDeployer.java:678) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:513) at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:481) at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at org.jboss.mx.capability.ReflectedMBeanDispatcher.invoke(ReflectedMBeanDispatcher.java:284) at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:491) at org.jboss.util.jmx.MBeanProxy.invoke(MBeanProxy.java:174) at $Proxy4.deploy(Unknown Source) at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:405) at org.jboss.deployment.scanner.URLDeploymentScanner.scanDirectory(URLDeploymentScanner.java:586) at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:465) at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:237) at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:162) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at
RE: [JBoss-user] XATxConnectionManager with Oracle?
Title: RE: [JBoss-user] XATxConnectionManager with Oracle? I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far 1. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes xaRes not enlisted. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else. 2. Although oracle xa driver accepts non-oracle Xid object, it seems to require that both getGlobalTransactionId and getBranchQualifier always return byte[64], otherwise it throws invalid transaction id during XAResource.end. Fixed XidImpl to return such arrays, not sure if it will work with all resource managers. 3. Currently I am trying to understand how XAManagedConnection#associateConnection(Object). Currently it unconditionally throws method not implemented exception. I would appreciate if anyone can comment on this... -Original Message- From: Geer, Benjamin [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 1:02 PM To: '[EMAIL PROTECTED]' Cc: Lindsay, Steve; Wink, Stephen Subject: [JBoss-user] XATxConnectionManager with Oracle? I'm trying to get XA transactions to work in JBoss 3.0.0 with Oracle 9i. I've tried the oracle-service.xml provided with JBoss in docs/examples/jca (which uses LocalTxConnectionManager), and it works fine. I modified it to make an oracle-xa-service.xml (attached), using XATxConnectionManager, and I'm testing it with a little MBean service (attached). I can get a DataSource, get a Connection from it, and do a SELECT, but when my service calls Connection.close(), I get the following exception: java.lang.IllegalArgumentException: xaRes not enlisted at org.jboss.tm.TxCapsule.delistResource(TxCapsule.java:546) (Full stack trace attached.) Can anyone tell me what I'm doing wrong? Ben
Re: [JBoss-user] XATxConnectionManager with Oracle?
Thanks for your work on this. Please post the results when you are satisfied. IMO the entire xa wrapper needs replacing which I unfortunately won't have time for soon. I'm not sure if associateConnection can be implemented easily. You can avoid it being called if you always close connection handles before calling other ejb methods (through home or remote interfaces) (and do not hold connections over method boundaries). So, try this: Connection c = myds.getConnection(); //do something c.close() myotherRemoteInterface.doSomethingElse(); c = myds.getConnection(); //do the rest of your work c.close(); david jencks On 2002.06.14 13:35:16 -0400 Igor Fedorenko wrote: I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far 1. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes xaRes not enlisted. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else. 2. Although oracle xa driver accepts non-oracle Xid object, it seems to require that both getGlobalTransactionId and getBranchQualifier always return byte[64], otherwise it throws invalid transaction id during XAResource.end. Fixed XidImpl to return such arrays, not sure if it will work with all resource managers. 3. Currently I am trying to understand how XAManagedConnection#associateConnection(Object). Currently it unconditionally throws method not implemented exception. I would appreciate if anyone can comment on this... -Original Message- From: Geer, Benjamin [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 1:02 PM To: '[EMAIL PROTECTED]' Cc: Lindsay, Steve; Wink, Stephen Subject: [JBoss-user] XATxConnectionManager with Oracle? I'm trying to get XA transactions to work in JBoss 3.0.0 with Oracle 9i. I've tried the oracle-service.xml provided with JBoss in docs/examples/jca (which uses LocalTxConnectionManager), and it works fine. I modified it to make an oracle-xa-service.xml (attached), using XATxConnectionManager, and I'm testing it with a little MBean service (attached). I can get a DataSource, get a Connection from it, and do a SELECT, but when my service calls Connection.close(), I get the following exception: java.lang.IllegalArgumentException: xaRes not enlisted at org.jboss.tm.TxCapsule.delistResource(TxCapsule.java:546) (Full stack trace attached.) Can anyone tell me what I'm doing wrong? Ben !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=iso-8859-1 META NAME=Generator CONTENT=MS Exchange Server version 5.5.2654.45 TITLERE: [JBoss-user] XATxConnectionManager with Oracle?/TITLE /HEAD BODY PFONT SIZE=2I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far/FONT/P PFONT SIZE=21. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes quot;xaRes not enlistedquot;. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else./FONT/P PFONT SIZE=22. Although oracle xa driver accepts non-oracle Xid object, it seems to require that both getGlobalTransactionId and getBranchQualifier always return byte[64], otherwise it throws quot;invalid transaction idquot; during XAResource.end. Fixed XidImpl to return such arrays, not sure if it will work with all resource managers./FONT/P PFONT SIZE=23. Currently I am trying to understand how XAManagedConnection#associateConnection(Object). Currently it unconditionally throws quot;method not implementedquot; exception. I would appreciate if anyone can comment on this.../FONT/P PFONT SIZE=2gt; -Original Message-/FONT BRFONT SIZE=2gt; From: Geer, Benjamin [A HREF=mailto:[EMAIL PROTECTED];mailto:[EMAIL PROTECTED]/A]/FONT BRFONT SIZE=2gt; Sent: Friday, June 14, 2002 1:02 PM/FONT BRFONT SIZE=2gt; To: '[EMAIL PROTECTED]'/FONT BRFONT SIZE=2gt; Cc: Lindsay, Steve; Wink, Stephen/FONT BRFONT SIZE=2gt; Subject: [JBoss-user] XATxConnectionManager with Oracle?/FONT BRFONT SIZE=2gt; /FONT BRFONT SIZE=2gt; /FONT BRFONT SIZE=2gt; I'm trying to get XA transactions to work in JBoss 3.0.0 with /FONT BRFONT SIZE=2gt; Oracle 9i./FONT BRFONT SIZE=2gt; /FONT BRFONT SIZE=2gt; I've tried the oracle-service.xml provided with JBoss
Re: [JBoss-user] XATxConnectionManager with Oracle?
This may be a little out of the topic, but I thought it won't hurt to have a look too: In my attempts to write a resource adapter I've noticed a strange behaviour (I also posted some messages on this forum about it): When the getConnection is called for the first time, everything works fine. For subsequent calls, the associateConnection() was called by the connection manager befor getConnection being invoked as if a handle to my previos connection was being held over method boundaries (I mention that I closed all connection handle in the same method though). Briefly, the cause was this: when a close() is sent, the managed connection calls close() too. Here a CONNECTION_CLOSED event is sent to the cm listener. JBoss expects the connection handle with the event too (for that use setConnectionHandle for an event), otherwise the connection handle is not properly unregistered by CachedConnectionManager and consequently next run it will appear as a connection held over method boundaries. Radu - Original Message - From: David Jencks [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Friday, June 14, 2002 2:01 PM Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? Thanks for your work on this. Please post the results when you are satisfied. IMO the entire xa wrapper needs replacing which I unfortunately won't have time for soon. I'm not sure if associateConnection can be implemented easily. You can avoid it being called if you always close connection handles before calling other ejb methods (through home or remote interfaces) (and do not hold connections over method boundaries). So, try this: Connection c = myds.getConnection(); //do something c.close() myotherRemoteInterface.doSomethingElse(); c = myds.getConnection(); //do the rest of your work c.close(); david jencks On 2002.06.14 13:35:16 -0400 Igor Fedorenko wrote: I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far 1. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes xaRes not enlisted. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else. 2. Although oracle xa driver accepts non-oracle Xid object, it seems to require that both getGlobalTransactionId and getBranchQualifier always return byte[64], otherwise it throws invalid transaction id during XAResource.end. Fixed XidImpl to return such arrays, not sure if it will work with all resource managers. 3. Currently I am trying to understand how XAManagedConnection#associateConnection(Object). Currently it unconditionally throws method not implemented exception. I would appreciate if anyone can comment on this... -Original Message- From: Geer, Benjamin [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 1:02 PM To: '[EMAIL PROTECTED]' Cc: Lindsay, Steve; Wink, Stephen Subject: [JBoss-user] XATxConnectionManager with Oracle? I'm trying to get XA transactions to work in JBoss 3.0.0 with Oracle 9i. I've tried the oracle-service.xml provided with JBoss in docs/examples/jca (which uses LocalTxConnectionManager), and it works fine. I modified it to make an oracle-xa-service.xml (attached), using XATxConnectionManager, and I'm testing it with a little MBean service (attached). I can get a DataSource, get a Connection from it, and do a SELECT, but when my service calls Connection.close(), I get the following exception: java.lang.IllegalArgumentException: xaRes not enlisted at org.jboss.tm.TxCapsule.delistResource(TxCapsule.java:546) (Full stack trace attached.) Can anyone tell me what I'm doing wrong? Ben !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=iso-8859-1 META NAME=Generator CONTENT=MS Exchange Server version 5.5.2654.45 TITLERE: [JBoss-user] XATxConnectionManager with Oracle?/TITLE /HEAD BODY PFONT SIZE=2I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far/FONT/P PFONT SIZE=21. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes quot;xaRes not enlistedquot;. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else./FONT/P
RE: [JBoss-user] XATxConnectionManager with Oracle?
Title: RE: [JBoss-user] XATxConnectionManager with Oracle? Thanks for a helpful hint, David. As you correctly guessed my test ssb was leaking sql connections. I'll post my patch and config files here shortly. -Original Message- From: David Jencks [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 2:01 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? Thanks for your work on this. Please post the results when you are satisfied. IMO the entire xa wrapper needs replacing which I unfortunately won't have time for soon. I'm not sure if associateConnection can be implemented easily. You can avoid it being called if you always close connection handles before calling other ejb methods (through home or remote interfaces) (and do not hold connections over method boundaries). So, try this: Connection c = myds.getConnection(); //do something c.close() myotherRemoteInterface.doSomethingElse(); c = myds.getConnection(); //do the rest of your work c.close(); david jencks On 2002.06.14 13:35:16 -0400 Igor Fedorenko wrote: I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far 1. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes xaRes not enlisted. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else. 2. Although oracle xa driver accepts non-oracle Xid object, it seems to require that both getGlobalTransactionId and getBranchQualifier always return byte[64], otherwise it throws invalid transaction id during XAResource.end. Fixed XidImpl to return such arrays, not sure if it will work with all resource managers. 3. Currently I am trying to understand how XAManagedConnection#associateConnection(Object). Currently it unconditionally throws method not implemented exception. I would appreciate if anyone can comment on this... -Original Message- From: Geer, Benjamin [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 1:02 PM To: '[EMAIL PROTECTED]' Cc: Lindsay, Steve; Wink, Stephen Subject: [JBoss-user] XATxConnectionManager with Oracle? I'm trying to get XA transactions to work in JBoss 3.0.0 with Oracle 9i. I've tried the oracle-service.xml provided with JBoss in docs/examples/jca (which uses LocalTxConnectionManager), and it works fine. I modified it to make an oracle-xa-service.xml (attached), using XATxConnectionManager, and I'm testing it with a little MBean service (attached). I can get a DataSource, get a Connection from it, and do a SELECT, but when my service calls Connection.close(), I get the following exception: java.lang.IllegalArgumentException: xaRes not enlisted at org.jboss.tm.TxCapsule.delistResource(TxCapsule.java:546) (Full stack trace attached.) Can anyone tell me what I'm doing wrong? Ben !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 3.2//EN HTML HEAD META HTTP-EQUIV=Content-Type CONTENT=text/html; charset=iso-8859-1 META NAME=Generator CONTENT=MS Exchange Server version 5.5.2654.45 TITLERE: [JBoss-user] XATxConnectionManager with Oracle?/TITLE /HEAD BODY PFONT SIZE=2I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far/FONT/P PFONT SIZE=21. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes quot;xaRes not enlistedquot;. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else./FONT/P PFONT SIZE=22. Although oracle xa driver accepts non-oracle Xid object, it seems to require that both getGlobalTransactionId and getBranchQualifier always return byte[64], otherwise it throws quot;invalid transaction idquot; during XAResource.end. Fixed XidImpl to return such arrays, not sure if it will work with all resource managers./FONT/P PFONT SIZE=23. Currently I am trying to understand how XAManagedConnection#associateConnection(Object). Currently it unconditionally throws quot;method not implementedquot; exception. I would appreciate if anyone can comment on this.../FONT/P PFONT SIZE=2gt; -Original Message-/FONT BRFONT SIZE=2gt; From: Geer, Benjamin [A HREF
RE: [JBoss-user] XATxConnectionManager with Oracle?
Title: RE: [JBoss-user] XATxConnectionManager with Oracle? Attached, please fine a patch which fixes problems with Oracle XA driver I have described earlier and example configuration file. The patch is against JBoss_3_0_0 cvs tag (branch?). Hope this helps. PS: sorry for html posting -Original Message- From: Igor Fedorenko [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 4:06 PM To: '[EMAIL PROTECTED]' Subject: RE: [JBoss-user] XATxConnectionManager with Oracle? Thanks for a helpful hint, David. As you correctly guessed my test ssb was leaking sql connections. I'll post my patch and config files here shortly. -Original Message- From: David Jencks [mailto:[EMAIL PROTECTED]] Sent: Friday, June 14, 2002 2:01 PM To: [EMAIL PROTECTED] Subject: Re: [JBoss-user] XATxConnectionManager with Oracle? Thanks for your work on this. Please post the results when you are satisfied. IMO the entire xa wrapper needs replacing which I unfortunately won't have time for soon. I'm not sure if associateConnection can be implemented easily. You can avoid it being called if you always close connection handles before calling other ejb methods (through home or remote interfaces) (and do not hold connections over method boundaries). So, try this: Connection c = myds.getConnection(); //do something c.close() myotherRemoteInterface.doSomethingElse(); c = myds.getConnection(); //do the rest of your work c.close(); david jencks On 2002.06.14 13:35:16 -0400 Igor Fedorenko wrote: I spent last two days trying to make this work and it looks like there are number of issues with both oracle xa datasource and jboss itself. I am getting close to have this configuration work (it's oracle 8.1.7.3 in my case but this should not make big difference). Problems that I've seen/fixed so far 1. Oracle xa driver returns difference XAResource for each call to XAConnection.getXAResource (see specs jdbc 2.0, section 7.2.2 why it should not). This problem causes xaRes not enlisted. Fixed XAManagedConnection to cache XAResource, this fix should not break anything else. 2. Although oracle xa driver accepts non-oracle Xid object, it seems to require that both getGlobalTransactionId and getBranchQualifier always return byte[64], otherwise it throws invalid transaction id during XAResource.end. Fixed XidImpl to return such arrays, not sure if it will work with all resource managers. oracle-xa.diff Description: Binary data oracle-xa-service.xml Description: Binary data