0

据我了解,GridGain 6 有一些定制的序列化,也将 H2 用于各种目的。

我们使用 H2 作为序列化对象存储。例如,这里是表模式的相关部分。

CREATE TABLE IF NOT EXISTS QUEUE (ID IDENTITY PRIMARY KEY, OBJECT OTHER NOT NULL ....)

尝试插入行时,出现以下错误。最后几行表明 GridH2IndexingSpi 已配置并且在某些方面失败(即使我的测试没有在 Grid 上运行)。由于 spi 源和我的调试器似乎不同步并且行号毫无意义,因此我无法轻松地进一步调试。

从我能够在 Utils.java 中调试的内容来看,似乎 gridgain 序列化程序已在 H2 中配置(静态 !!!!)并且正在使用中。

关于如何解决或避免这种情况的任何想法?我尝试了各种 H2 版本,例如 1.3.176(gridgain 使用)和较新的 1.4.177,但正如预期的那样,它们没有任何区别,因为问题在于使用索引 spi。

如果有帮助,我可以尝试创建一个小型 H2 / Gridgain 项目来说明问题。

谢谢

Exception in thread "pool-4-thread-1"  org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL []; SQL state [90026]; error code [90026]; Serialization failed, cause: "java.lang.NullPointerException"; SQL statement:
INSERT INTO QUEUE (OBJECT....) VALUES (?,?,?,?) [90026-170]; nested exception is org.h2.jdbc.JdbcSQLException: Serialization failed, cause: "java.lang.NullPointerException"; SQL statement:
INSERT INTO QUEUE (OBJECT, ....) VALUES (?,?,?,?) [90026-170]
....
Caused by: org.h2.jdbc.JdbcSQLException: Serialization failed, cause: "java.lang.NullPointerException"; SQL statement:
INSERT INTO QUEUE (OBJECT, ....) VALUES (?,?,?,?) [90026-170]
at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
at org.h2.message.DbException.get(DbException.java:158)
....
Caused by: java.lang.NullPointerException
at org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi.access$100(GridH2IndexingSpi.java:145)
at org.gridgain.grid.spi.indexing.h2.GridH2IndexingSpi$1.serialize(GridH2IndexingSpi.java:201)
at org.h2.util.Utils.serialize(Utils.java:273)
... 27 more
4

2 回答 2

1

I finally understood what's happening. At the point when GridGain H2 integration was implemented, H2 had only one static serializer. That's why GridGain is using a static property. As a possible workaround for the problem can you try setting in your H2 database your custom serializer which will in fact utilize usual H2 serialization?

Latest H2 version supports specifying per-database serializer and GridGain will fix that in upcoming version.

于 2014-05-07T18:28:17.757 回答
0

我不确定你在用 H2 做什么,但你不应该使用与 GridGain 内部使用的相同的 H2 数据库。

GridGain 在内部使用 H2 专门用于 SQL 索引和查询功能。

于 2014-05-06T00:13:29.483 回答