Subject couldn't start local transaction...
Author Mandip S. Sangha
Hi All

I'm running some junit tests with the client-java driver and getting the
following error from my output:

[junit] com.is.jrf.DatabaseException: java.sql.SQLException:
ResourceException: javax.resource.ResourceException: couldn't start
local transaction: javax.transaction.xa.XAException: unable to complete
network request to host : SELECT Person.PersonId, Person.Name,
Person.Age, Person.Wealthy, Person.LastUpdated,
Employee.ManagerPersonId, Employee.DepartmentCode FROM Person INNER JOIN
Employee ON Person.PersonId=Employee.PersonId:

[junit] ResourceException: javax.resource.ResourceException: couldn't
start local transaction: javax.transaction.xa.XAException: unable to
complete network request to host

with the test.log as follows:

[JDBCHelper,DEBUG] Checking to see if connection is valid: null
[JDBCHelper,DEBUG] About to get a new connection.
[JDBCHelper,DEBUG] Driver Class: org.firebirdsql.jdbc.FBDriver
[JDBCHelper,DEBUG] Connection was created:
org.firebirdsql.jdbc.FBConnection@6e1fb1
[AbstractDomain,DEBUG] AbstractDomain.validate(test.Manufacturer@6bd8ea,
JDBCHelper #21)
[JDBCHelper,DEBUG] Checking to see if connection is valid:
org.firebirdsql.jdbc.FBConnection@6e1fb1
[sql,DEBUG] [SELECT count(*) FROM Manufacturer WHERE Manufacturer.ID=789
AND Manufacturer.Code='ACME3'] JDBCHelper #21
[FBManagedConnection,DEBUG] start called:
org.firebirdsql.jca.FBLocalTransaction$FBLocalXid@e2cb55
[GDS_Impl,DEBUG] Got socket
[GDS_Impl,DEBUG] user.name: mandip
[GDS_Impl,DEBUG] op_connect
[GDS_Impl,DEBUG] sent
[GDS_Impl,DEBUG] op_accept
[FBManagedConnectionFactory,ERROR] GDS Exception in getDbHandle
org.firebirdsql.gds.GDSException: unable to complete network request to host
at org.firebirdsql.jgds.GDS_Impl.connect(GDS_Impl.java:1304)
at
org.firebirdsql.jgds.GDS_Impl.isc_attach_database(GDS_Impl.java:263)
at
org.firebirdsql.jgds.GDS_Impl.isc_attach_database(GDS_Impl.java:247)
at
org.firebirdsql.jca.FBManagedConnectionFactory.getDbHandle(FBManagedConnectionFactory.java:455)
at
org.firebirdsql.jca.FBManagedConnection.getIscDBHandle(FBManagedConnection.java:749)
at
org.firebirdsql.jca.FBManagedConnectionFactory.getCurrentIscTrHandle(FBManagedConnectionFactory.java:414)
at
org.firebirdsql.jca.FBManagedConnection.findIscTrHandle(FBManagedConnection.java:740)
at
org.firebirdsql.jca.FBManagedConnection.start(FBManagedConnection.java:575)
at
org.firebirdsql.jca.FBLocalTransaction.begin(FBLocalTransaction.java:86)
at
org.firebirdsql.jdbc.FBConnection.ensureInTransaction(FBConnection.java:829)
at
org.firebirdsql.jdbc.FBStatement.executeQuery(FBStatement.java:96)
at com.is.util.sql.JDBCHelper.executeQuery(Unknown Source)
at com.is.jrf.AbstractColumnSpec.validateUnique(Unknown Source)
at
com.is.jrf.CompoundPrimaryKeyColumnSpec.validateUnique(Unknown Source)
at com.is.jrf.AbstractDomain.validate(Unknown Source)
at com.is.jrf.AbstractDomain.save(Unknown Source)
at com.is.jrf.AbstractDomain.save(Unknown Source)
at test.DomainTEST.populateManufacturer(Unknown Source)
at test.DomainTEST.test020ReadCompoundKey(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:231)
at
org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:409)
[FBLocalTransaction,WARN] couldn't start local transaction:

The most bizarre thing being that the error jumps from one test to
another for no apparent reason.

Any comments/suggestions would be greatly appreciated.

Regards
Mandip