Subject Unrecognized transaction problem
Author bullitenergy
Hello Everyone!

My knowledge and experience with transactions is severly lacking. Can
someone explain how i should solve the "Unrecognized transaction"
exception? The exception only occurs upon selecting an existing
primary key value in the table. I was under the (wrong?) impression
that no transaction problems would surface using the default
autocommit mode. I am using Jaybird 1.5.1 and Firebird 1.5.1.4481.

Thank you!
Best Regards,
Bullit Energy

---
System.out.println("transaction isolation: " +
connection.getTransactionIsolation());
/* 2 = TRANSACTION_READ_COMMITTED */

System.out.println("autocommit: " + connection.getAutoCommit());
/* true */

boolean exist = false;
try{
PreparedStatement ps = connection.prepareStatement("SELECT 1 FROM
\"BEHAVIORS\" WHERE \"BEHAVIORCODE\" = ? AND \"DESCRIPTION\" = ?");
ps.setString(1, "CA");
/* Unrecognized transaction upon an existing key value */
ps.setString(2, "whatever");
ResultSet rs = ps.executeQuery();
exist = rs.next();
rs.close();
} catch(Exception e) {
e.printStackTrace();
System.exit(1);
}

System.out.println("data exists: " + exist);

---

transaction isolation: 2
autocommit: true
org.firebirdsql.jdbc.FBSQLException: Resource Exception. Unrecognized
transaction
Reason: Unrecognized transaction
at
org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction(AbstractC
onnection.java:872)
at
org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction(AbstractC
onnection.java:856)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.executeQuery(AbstractP
reparedStatement.java:120)
at
com.objectadapter.datastation.DataImportExport.main(DataImportExport.
java:27)
at org.firebirdsql.jca.FBXAException: Unrecognized transaction
at
org.firebirdsql.jca.FBManagedConnection.internalEnd(FBManagedConnecti
on.java:455)
at
org.firebirdsql.jca.FBLocalTransaction.internalCommit(FBLocalTransact
ion.java:154)
at
org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction(AbstractC
onnection.java:866)
at
org.firebirdsql.jdbc.AbstractConnection.checkEndTransaction(AbstractC
onnection.java:856)
at
org.firebirdsql.jdbc.AbstractPreparedStatement.executeQuery(AbstractP
reparedStatement.java:120)
at
main(DataImportExport.java:27)