提交 1fbc62bd authored 作者: Thomas Mueller's avatar Thomas Mueller

The LOB storage (when the system property h2.lobInDatabase is set) is now only…

The LOB storage (when the system property h2.lobInDatabase is set) is now only initialized when needed.
上级 2e6af1b8
...@@ -72,7 +72,7 @@ public class LobStorage { ...@@ -72,7 +72,7 @@ public class LobStorage {
/** /**
* Initialize the lob storage. * Initialize the lob storage.
*/ */
public void init() { private void init() {
if (init) { if (init) {
return; return;
} }
...@@ -379,6 +379,7 @@ public class LobStorage { ...@@ -379,6 +379,7 @@ public class LobStorage {
*/ */
public ValueLobDb copyLob(int type, long oldLobId, int tableId, long length) { public ValueLobDb copyLob(int type, long oldLobId, int tableId, long length) {
try { try {
init();
long lobId = getNextLobId(); long lobId = getNextLobId();
PreparedStatement prep = prepare( PreparedStatement prep = prepare(
"INSERT INTO " + LOB_MAP + "(LOB, SEQ, HASH, BLOCK) " + "INSERT INTO " + LOB_MAP + "(LOB, SEQ, HASH, BLOCK) " +
...@@ -590,6 +591,7 @@ public class LobStorage { ...@@ -590,6 +591,7 @@ public class LobStorage {
*/ */
public void setTable(long lobId, int table) { public void setTable(long lobId, int table) {
try { try {
init();
PreparedStatement prep = prepare("UPDATE " + LOBS + " SET TABLE = ? WHERE ID = ?"); PreparedStatement prep = prepare("UPDATE " + LOBS + " SET TABLE = ? WHERE ID = ?");
prep.setInt(1, table); prep.setInt(1, table);
prep.setLong(2, lobId); prep.setLong(2, lobId);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论