提交 6211574a authored 作者: noelgrandin's avatar noelgrandin

fix to previous commit, "-1" is valid value for in-memory DB

上级 369f2922
......@@ -156,8 +156,13 @@ public class Set extends Prepared {
break;
}
case SetTypes.DB_CLOSE_DELAY: {
if (getIntValue() < 0) {
throw DbException.getInvalidValueException("DB_CLOSE_DELAY", getIntValue());
int x = getIntValue();
if (!session.getDatabase().isPersistent() && x == -1) {
// -1 is a special value for in-memory databases,
// which means "keep the DB alive and use the same DB for all connections"
}
else if (x < 0) {
throw DbException.getInvalidValueException("DB_CLOSE_DELAY", x);
}
session.getUser().checkAdmin();
database.setCloseDelay(getIntValue());
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论