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

Lob in database: after the process was killed while adding a lob, inserting a…

Lob in database: after the process was killed while adding a lob, inserting a lob could throw an exception (primary key violation in LOB_MAP).
上级 369482ae
...@@ -110,7 +110,12 @@ public class LobStorage { ...@@ -110,7 +110,12 @@ public class LobStorage {
PreparedStatement prep = prepare("SELECT MAX(LOB) FROM " + LOB_MAP); PreparedStatement prep = prepare("SELECT MAX(LOB) FROM " + LOB_MAP);
ResultSet rs = prep.executeQuery(); ResultSet rs = prep.executeQuery();
rs.next(); rs.next();
return rs.getLong(1) + 1; long x = rs.getLong(1) + 1;
prep = prepare("SELECT MAX(ID) FROM " + LOBS);
rs = prep.executeQuery();
rs.next();
x = Math.max(x, rs.getLong(1) + 1);
return x;
} }
/** /**
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论