Subject Re: [Firebird-Java] couldn't start local transaction...
Author Mandip S. Sangha
Hi David

Thanks for the quick response.

> Do some of your tests succeed?
Yes.

> Does some test before the one that fails in this way do something that
> might break the connection?
Most definitely, all queries/updates executed within each test open and
close their own connections individually. Infact, spanning all the
tests that succeed, 40-50 queries/updates execute successfully in this
manner and only then is the error thrown. This is the reason why I
thought it could be a client-java issue since a fair number of
queries/updates execute using the above mechanism and only then is an
error thrown which is seemingly unrelated to the tests...

> If you are using the built in pooling,
No I'm not :-)

I will look into this problem a bit further and get back to you.

Regards
Mandip

David Jencks wrote:

> Either you can't get a connection due to misconfiguration or the server
> dying or a connection died and the driver didn't notice. Due to adapting
> firebird to xa semantics the driver doesn't actually make a connection
> until it knows what transaction you are working in.
>
> Do some of your tests succeed?
> Does some test before the one that fails in this way do something that
> might break the connection?
> If you are using the built in pooling, try turning it off and see what
> happens: if you aren't, you might try turning it on;-)
>
> david jencks
>
>
> On 2002.03.20 12:06:30 -0500 Mandip S. Sangha wrote:
>
>>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
>>
>>
>>
>>To unsubscribe from this group, send an email to:
>>Firebird-Java-unsubscribe@yahoogroups.com
>>
>>
>>
>>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>>
>>
>>
>>
>>
>>
>
>
> To unsubscribe from this group, send an email to:
> Firebird-Java-unsubscribe@yahoogroups.com
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>