【发布时间】:2011-01-01 18:07:03
【问题描述】:
我正在使用 Glassfish v2、Hibernate 和 Annotations+EntityManager 和 Postgresql 8.4。 我也在使用 HibernateSpatial 和 PostGis。 将具有空间属性 (com.vividsolutions.jts.geom.Point) 的实体持久保存到 Postgis 数据库中效果很好。
但是,当尝试使用 myEntityManager.find(MyClass.class, key) 获取对象时,出现以下异常:Can't convert object of type org.postgresql.util.PGobject
我不确定,但是google了一下,好像我用来访问Postgres数据库的连接池缺少org.postgis.DriverWrapper,这就是为什么Point属性对应的数据库PGobject不能转换的原因返回。
我找不到如何将此包装器添加到连接池。 有人可以解释如何为 PostGis 连接配置连接池吗?或者指出这个异常是否来自另一个错误?
谢谢 塔托克斯
【问题讨论】:
标签: hibernate jdbc connection-pooling postgis