提交 30ad944b authored 作者: Noel Grandin's avatar Noel Grandin

Fix bug where a lock on the SYS table was not released when closing a session…

Fix bug where a lock on the SYS table was not released when closing a session that contained a temp table with an LOB column.
上级 2cf82226
......@@ -21,6 +21,9 @@ Change Log
<h2>Next Version (unreleased)</h2>
<ul>
<li>Fix bug where a lock on the SYS table was not released when closing a session that contained a temp
table with an LOB column.
</li>
<li>Issue #255: ConcurrentModificationException with multiple threads in embedded mode and temporary LOBs
</li>
<li>Issue #235: Anonymous SSL connections fail in many situations
......
......@@ -814,7 +814,7 @@ public class Session extends SessionWithState {
if (!closed) {
try {
database.checkPowerOff();
rollback();
rollback(); // release any open table locks
removeTemporaryLobs(false);
cleanTempTables(true);
undoLog.clear();
......@@ -950,6 +950,10 @@ public class Session extends SessionWithState {
table.truncate(this);
}
}
// sometimes Table#removeChildrenAndResources will take the meta lock
if (closeSession) {
database.unlockMeta(this);
}
}
}
}
......
......@@ -35,6 +35,7 @@ public class TestTransaction extends TestBase {
@Override
public void test() throws SQLException {
testClosingConnectionWithSessionTempTable();
testClosingConnectionWithLockedTable();
testConstraintCreationRollback();
testCommitOnAutoCommitChange();
......@@ -354,6 +355,23 @@ public class TestTransaction extends TestBase {
c2.close();
}
private void testClosingConnectionWithSessionTempTable() throws SQLException {
deleteDb("transaction");
Connection c1 = getConnection("transaction");
Connection c2 = getConnection("transaction");
c1.setAutoCommit(false);
c2.setAutoCommit(false);
Statement s1 = c1.createStatement();
s1.execute("create local temporary table a (id int, x BLOB)");
c1.commit();
c1.close();
Statement s2 = c2.createStatement();
s2.execute("create table c (id int)");
c2.close();
}
private void testSavepoint() throws SQLException {
deleteDb("transaction");
Connection conn = getConnection("transaction");
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论