-
1. Re: DB2 XA connection problem - Non XA works
weston.price Nov 26, 2006 6:24 PM (in response to jshrinivas)Yep. The db2jcc driver does not support native XA. As a result, you have to install the DB2 client libraries to get XA support.
-
2. Re: DB2 XA connection problem - Non XA works
jshrinivas Nov 27, 2006 3:06 PM (in response to jshrinivas)Hi,
Thanks for your reply. I am looking for the client libraries and will post an update on how it goes.
In the mean time I want to make sure if there is actually a problem or I am just missing something here. From the exception it looks like it is trying to use Type 2 driver (T2 in the error) but isn't db2jcc.jar Type 4 driver? Is there any way you can specify JBoss to use Type 4 URL (as I think thats the only way it decides whether to use Type 2 or Type 4). Here is what I have specified currently in the db2-xa-ds.xml:
<xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
<xa-datasource-property name="DatabaseName">db_name</xa-datasource-property>
<xa-datasource-property name="ServerName">db_host</xa-datasource-property>
<xa-datasource-property name="PortNumber">db_port</xa-datasource-property>
<xa-datasource-property name="User">db_user</xa-datasource-property>
<xa-datasource-property name="Password">db_pass</xa-datasource-property>
Thanks,
-Shrinivas -
3. Re: DB2 XA connection problem - Non XA works
weston.price Nov 27, 2006 3:10 PM (in response to jshrinivas)The db2jcc driver is Type4, but XA support is not provided in a Type4 configuration. As opposed to Oracle, DB2 relies on native code to support XA functionality. As a result, the DB2 client has to be installed. You can indeed use Type4 configuration syntax, but you still need the libraries to support XA.
-
4. Re: DB2 XA connection problem - Non XA works
jshrinivas Nov 27, 2006 3:10 PM (in response to jshrinivas)Some platform details:
DB2 - V 8.2.0 on RHEL 4
Drivers: IBM DB2 JDBC Universal Driver Architecture 2.3.63
AMD_64 hardware
JBoss 4.0.5-SP1-ejb3 on RHEL 4
built from source using Sun JDK 1.5 U9 -
5. Re: DB2 XA connection problem - Non XA works
jshrinivas Nov 27, 2006 3:14 PM (in response to jshrinivas)Thanks for your quick reply. I will try with installing DB2 client.
Appreciate your help
-Shrinivas -
6. Re: DB2 XA connection problem - Non XA works
weston.price Nov 27, 2006 3:17 PM (in response to jshrinivas)No problem. It's a known limitation of the db2jcc driver. More can be found here:
http://www-128.ibm.com/developerworks/db2/library/techarticle/dm-0402kitchlu/ -
7. Re: DB2 XA connection problem - Non XA works
jshrinivas Nov 28, 2006 12:39 PM (in response to jshrinivas)I tried installing the DB2 Application Development Client (http://www-306.ibm.com/software/data/db2/udb/support/downloadv8_linuxamd2664bit.html ), configured the client to connect to DB2 server, tested the connection through DB2 CLI and it works through CLI. However, I still get the same error during JBoss startup. Am I missing something here.
Thanks,
-Shrinivas -
8. Re: DB2 XA connection problem - Non XA works
weston.price Nov 28, 2006 1:26 PM (in response to jshrinivas)If using the Type4 driver I believe (from what I remember) you have to tell the datasource to treat the resource as Type2. This should be a configuration property.
Try this:
<xa-datasource-property name="DriverType">2</xa-datasource-property>
If he still can find the client libraries then you may have to modify your LD_LIBRARY_PATH or other environment variable. -
9. Re: DB2 XA connection problem - Non XA works
jshrinivas Nov 28, 2006 3:03 PM (in response to jshrinivas)Thanks again for your help. Here are the things that I tried:
"DriverType" = 2 - still failed to load native libs
"DriverType" = 2 and LD_LIBRARY_PATH set to DB_INSTANCE/lib(64)/ - SQL10007N Message "-1390" could not be retrieved. Reason code: "3"
"DriverType" = 2, LD_LIBRARY_PATH set and defined DB2INSTANCE env var (source db2profile should take care of this) - XA connection established
"DriverType" = 4 - JBoss starts up without DB conn errors.
Eventhough last 2 options are working in theory I am getting Tx related errors esp. RollbackException, Commit errors etc, but I guess that could be just because of the underlying J2EE application.
I just thought it would be helpful to those who face this issue in future.
Thanks,
-Shrinivas -
10. Re: DB2 XA connection problem - Non XA works
weston.price Nov 28, 2006 3:12 PM (in response to jshrinivas)I just fired up my instance of DB2. I will take a look.
-
11. Re: DB2 XA connection problem - Non XA works
weston.price Dec 6, 2006 4:23 PM (in response to jshrinivas)I was able to get this to run on an AMD64 system with no issues. Note, DB2 seems to want it's libraries first in the LD_LIBRARY_PATH. Also, use of the db2profile script seems to be required.
-
12. Re: DB2 XA connection problem - Non XA works
jshrinivas Dec 6, 2006 6:00 PM (in response to jshrinivas)Thanks for your help. It works with native libraries now.
Thanks again
-Shrinivas