Subject | Re: Unrecognized transaction problem |
---|---|
Author | bullitenergy |
Post date | 2004-10-14T11:26:22Z |
Hey Roman,
I think it is reproducable here is a sort of minimalistic testcase:
Best regard,
Bullit Energy
--- Bug.java
import java.sql.*;
/** c:/test.fdb database:
CREATE TABLE "T1"
(
"C1" CHAR(2) CHARACTER SET ASCII NOT NULL,
"C2" BLOB SUB_TYPE TEXT CHARACTER SET ASCII NOT NULL
);
ALTER TABLE "T1" ADD CONSTRAINT "T1_C1"
PRIMARY KEY ("C1");
COMMIT;
INSERT INTO "T1"
VALUES ('XX', 'no more bugs');
COMMIT;
*/
class Bug {
static Connection connection;
public static void test(String key) throws SQLException {
PreparedStatement ps = connection.prepareStatement("SELECT 1 FROM
\"T1\" WHERE \"C1\" = ? AND \"C2\" = ?");
ps.setString(1, key);
ps.setString(2, "bug busters");
ResultSet rs = ps.executeQuery();
boolean exist = rs.next();
rs.close();
System.out.println("data exists: " + exist);
}
public static void main(String[] args) throws
ClassNotFoundException, SQLException {
System.out.println("BUG: Unrecognized transaction");
Class.forName("org.firebirdsql.jdbc.FBDriver");
connection =
DriverManager.getConnection("jdbc:firebirdsql://localhost:3050/C:/test.fdb?lc_ctype=UNICODE_FSS",
"sysdba", "masterkey");
try{
test("xx"); // works: key not in table
test("XX"); // fails: FBSQLException: Resource Exception.
Unrecognized transaction
} catch(Exception e) {
e.printStackTrace();
System.exit(1);
}
}
}
I think it is reproducable here is a sort of minimalistic testcase:
Best regard,
Bullit Energy
--- Bug.java
import java.sql.*;
/** c:/test.fdb database:
CREATE TABLE "T1"
(
"C1" CHAR(2) CHARACTER SET ASCII NOT NULL,
"C2" BLOB SUB_TYPE TEXT CHARACTER SET ASCII NOT NULL
);
ALTER TABLE "T1" ADD CONSTRAINT "T1_C1"
PRIMARY KEY ("C1");
COMMIT;
INSERT INTO "T1"
VALUES ('XX', 'no more bugs');
COMMIT;
*/
class Bug {
static Connection connection;
public static void test(String key) throws SQLException {
PreparedStatement ps = connection.prepareStatement("SELECT 1 FROM
\"T1\" WHERE \"C1\" = ? AND \"C2\" = ?");
ps.setString(1, key);
ps.setString(2, "bug busters");
ResultSet rs = ps.executeQuery();
boolean exist = rs.next();
rs.close();
System.out.println("data exists: " + exist);
}
public static void main(String[] args) throws
ClassNotFoundException, SQLException {
System.out.println("BUG: Unrecognized transaction");
Class.forName("org.firebirdsql.jdbc.FBDriver");
connection =
DriverManager.getConnection("jdbc:firebirdsql://localhost:3050/C:/test.fdb?lc_ctype=UNICODE_FSS",
"sysdba", "masterkey");
try{
test("xx"); // works: key not in table
test("XX"); // fails: FBSQLException: Resource Exception.
Unrecognized transaction
} catch(Exception e) {
e.printStackTrace();
System.exit(1);
}
}
}