I have a problem when running the Jaybird 2.2 branch test suite against
Firebird 3. One of the tests fails to drop a table with the exception
(on an implicit commit by Jaybird):
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544345. lock
conflict on no wait transaction
unsuccessful metadata update
object TABLE "LONGTEST" is in use
This only happens when the test is executed with a transaction setting
read_committed, rec_version, write, **no_wait** (instead of the default
which uses wait). I am wondering why using a no wait transaction in this
test prevents the table from being dropped (while this works ok in
Firebird 2.5, and use of a wait transaction works fine as well).
The test is:
public void testLongRange() throws Exception {
Connection c = getConnectionViaDriverManager();
try {
Statement s = c.createStatement();
try {
s.execute("CREATE TABLE LONGTEST (LONGID DECIMAL(18)
NOT NULL PRIMARY KEY)");
try {
s.execute("INSERT INTO LONGTEST (LONGID) VALUES ("
+ Long.MAX_VALUE + ")");
ResultSet rs = s.executeQuery("SELECT LONGID FROM
LONGTEST");
try {
assertTrue("Should have one row!", rs.next());
assertTrue("Retrieved wrong value!",
rs.getLong(1) == Long.MAX_VALUE);
} finally {
rs.close();
}
s.execute("DELETE FROM LONGTEST");
s.execute("INSERT INTO LONGTEST (LONGID) VALUES ("
+ Long.MIN_VALUE + ")");
rs = s.executeQuery("SELECT LONGID FROM LONGTEST");
try {
assertTrue("Should have one row!", rs.next());
assertTrue("Retrieved wrong value!",
rs.getLong(1) == Long.MIN_VALUE);
} finally {
rs.close();
}
} finally {
s.execute("DROP TABLE LONGTEST");
}
} finally {
s.close();
}
} finally {
c.close();
}
}
Note that this uses autocommit, so each statement execute commits a
previously started transaction and starts a new transaction and - if
possible - commits itself after execute (only if the statement has no
result set).
Mark
--
Mark Rotteveel
------------------------------------------------------------------------------
Dive into the World of Parallel Programming The Go Parallel Website, sponsored
by Intel and developed in partnership with Slashdot Media, is your hub for all
things parallel software development, from weekly thought leadership blogs to
news, videos, case studies, tutorials and more. Take a look and join the
conversation now. http://goparallel.sourceforge.net/
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel