lealone / Lealone

比 MySQL 和 MongoDB 快10倍的 OLTP 关系数据库和文档数据库
Other
2.44k stars 513 forks source link

CLOB 字段在 embed 和 client-server 不一致 #160

Closed cbqqkcel closed 1 year ago

cbqqkcel commented 1 year ago

CLOB 字段 VALUE 用 client-server 模式下是正常的。 当我用embed指定数据库文件到client-server 存放的目录启动时,其他的非 CLOB 的数据都是可以查出来的。切换到 embed 报如下错误,是我用的方式不对吗(我目前的理解是大家一起开发用 client-server ,发布到生产用 embed)

Error attempting to get column 'value' from result set. Cause: org.lealone.common.exceptions.JdbcSQLException: General error: \"java.lang.NullPointerException\" [50000-0]\n; uncategorized SQLException; SQL state [HY000]; error code [50000]; General error: \"java.lang.NullPointerException\" [50000-0]; nested exception is org.lealone.common.exceptions.JdbcSQLException: General error: \"java.lang.NullPointerException\" [50000-0]

也有可能是 java 代码的问题(用了mybatis-plus,去掉连接池了)还没迁移 ORM 好像第一次原始数据都是可以的。我用全量备份后把数据替换就只有 client-server 能用了。

codefollower commented 1 year ago

embed 和 client-server 都是一样的,睡觉了,明天我再查一下,看看能不能重现你的问题。

codefollower commented 1 year ago

可以了,在嵌入模式下访问 client-server 模式写入的任何数据,只要把 BaseDir 指向 client-server 模式的 BaseDir 即可。 参考 JdbcClobEmbedTest

cbqqkcel commented 1 year ago

可以了,嵌入式 client-server backup 的在他们之间随便切换都没问题。