Transactions with isc_tpb_autocommit can hang the server
--------------------------------------------------------
Key: CORE-4840
URL: http://tracker.firebirdsql.org/browse/CORE-4840
Project: Firebird Core
Issue Type: Bug
Components: Engine
Affects Versions: 3.0 Beta 2
Environment: Snapshot Firebird-3.0.0.31881-0_x64 Windows 8.1 64 bit,
Jaybird 3.0 master
SharedCache = true
SharedDatabase = false
Reporter: Mark Rotteveel
Priority: Blocker
Attachments: TpbAutocommitTest.java
I was testing the pull request of Maxim for Jaybird. A test that creates a
stored procedure and adds a comment on that stored procedure in a transaction
with isc_tpb_autocommit hangs the entire Firebird 3 server. The Firebird 3
server stops responding entirely.
The test is (see also attachment):
private static final String CREATE_PROCEDURE =
"CREATE PROCEDURE testproc1 (IN1 INTEGER, IN2 FLOAT)" +
"RETURNS (OUT1 VARCHAR(20), " +
" OUT2 DOUBLE PRECISION, OUT3 INTEGER) AS " +
" DECLARE VARIABLE X INTEGER;" +
"BEGIN" +
" OUT1 = 'Out String';" +
" OUT2 = 45;" +
" OUT3 = IN1;" +
"END";
private static final String ADD_COMMENT = "COMMENT ON PROCEDURE testproc1
IS 'Test description'";
@Test
public void iscTpbAutocommit_hangsServer() throws SQLException {
try (FbDatabase db = createDatabaseConnection()) {
db.attach();
TransactionParameterBuffer tpb = new
TransactionParameterBufferImpl();
tpb.addArgument(ISCConstants.isc_tpb_read_committed);
tpb.addArgument(ISCConstants.isc_tpb_rec_version);
tpb.addArgument(ISCConstants.isc_tpb_write);
tpb.addArgument(ISCConstants.isc_tpb_wait);
tpb.addArgument(ISCConstants.isc_tpb_autocommit);
FbTransaction transaction = db.startTransaction(tpb);
try {
FbStatement statement = db.createStatement(transaction);
statement.prepare(CREATE_PROCEDURE);
statement.execute(RowValue.EMPTY_ROW_VALUE);
statement.prepare(ADD_COMMENT);
statement.execute(RowValue.EMPTY_ROW_VALUE);
} finally {
transaction.commit();
}
}
}
The same test runs fine against Firebird 2.5.4.
The firebird.log contains:
RAMONA Sun Jun 14 10:56:16 2015
Database: D:\DEVELOPMENT\PROJECT\JAYBIRD\JAYBIRD\FBTEST.FDB
internal Firebird consistency check (Too many savepoints (287), file:
tra.cpp line: 2470)
RAMONA Sun Jun 14 10:56:16 2015
Database: D:\DEVELOPMENT\PROJECT\JAYBIRD\JAYBIRD\FBTEST.FDB
internal Firebird consistency check (Too many savepoints (287), file:
tra.cpp line: 2470)
internal Firebird consistency check (wrong record version (185), file:
vio.cpp line: 3740)
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel