Brett Wooldridge wrote:
Hello list,
I am stuck trying to figure out an issue with using the Bitronix JTA
Transaction Manager with Derby (v10.3.2.1). Here’s the details:
I’m running Derby as a network server on the standard port. I have a
unit test which uses the ClientXADatasource to connect to my Derby
database, and this succeeds.
The client code looks like this:
ClientXADataSource ds = new ClientXADataSource();
ds.setDatabaseName("ziptie"); ds.setPortNumber(1527);
ds.setServerName("localhost"); Connection connection =
ds.getConnection();
As I said, this client connects successfully, and the derby.log records
this:
Connection number: 2.
2008-03-16 11:45:05.302 GMT Thread[DRDAConnThread_6,5,derby.daemons]
(DATABASE = ziptie), (DRDAID = {2}), Apache Derby Network Server
connected to database ziptie
Then, I try to start an application which uses the Bitronix TM to
perform a similar connection to Derby. However, this connection fails
as recorded by the derby.log as well:
Connection number: 3.
2008-03-16 11:45:10.817 GMT Thread[DRDAConnThread_6,5,derby.daemons]
(DATABASE = ziptie), (DRDAID = {3}), Database not available
The properties for Bitronix look like this:
resource.ds.className=org.apache.derby.jdbc.ClientXADataSource
resource.ds.uniqueName=ziptie
resource.ds.driverProperties.databaseName=ziptie
resource.ds.driverProperties.serverName=localhost
resource.ds.driverProperties.portNumber=1527
Hello Brett,
I have never used BTM, but I found it on Codehaus and downloaded the
newUserDemo (look under "New user's guide"). The demo already uses
Derby, but obtains the connections through an embedded XA data source.
I modified the demo to use ClientXADataSource, and it worked fine.
Could you have a look, maybe try to replace the settings with your
specific settings, and see if it works for you?
(to use it against your own server, you only need to create one simple
table in your database).
If the demo works, but your application doesn't, are you able to modify
the demo to reproduce the problem?
What distinguishes your setup from the simple setup in the demo?
I tried with Derby 10.2.2.0, 10.3.2.1 and 10.5 alpha (development version).
Sorry I can't provide more help, but maybe the demo thing can give us a
lead to follow?
FYI: I did not check under which license the demo is distributed.
regards,
--
Kristian
[ snip - DRDA traces ]