提交 ba641b68 authored 作者: Thomas Mueller's avatar Thomas Mueller

The native fulltext index kept a reference to a database after the database was closed.

上级 f61fcf67
...@@ -104,6 +104,13 @@ class FullTextSettings { ...@@ -104,6 +104,13 @@ class FullTextSettings {
return path; return path;
} }
/**
* Prepare a statement. The statement is cached in a soft reference cache.
*
* @param conn the connection
* @param sql the statement
* @return the prepared statement
*/
synchronized PreparedStatement prepare(Connection conn, String sql) throws SQLException { synchronized PreparedStatement prepare(Connection conn, String sql) throws SQLException {
PreparedStatement prep = cache.get(sql); PreparedStatement prep = cache.get(sql);
if (prep != null && prep.getConnection().isClosed()) { if (prep != null && prep.getConnection().isClosed()) {
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论