使用 JDO/DataNucleus 的容器管理事务
大家早上好,
我目前正在玩 Datanucleus/JDO。我喜欢的一件事是类型安全的查询系统,我想在未来的项目中使用 Datanucleus(我来自 Hibernate 背景)。 我想让容器(JBOSS 5)管理事务,并且我已经按照 datanucleus 用户的指示定义了一个数据源(datanucleus 论坛帖子),唯一的问题是我无法理解如何获取 JDOPersistenceManager,我从 jndi 查找中得到的只是 PersistenceManager,如果我尝试强制转换为 JDOPersistenceManager i将得到 ClassCastException。 我需要 JDOPersistenceManager 来获取类型安全的查询... 我的配置与线程中解释的配置相同。
以前有人遇到过同样的问题吗? 我也想知道这件事是否有可能......
谢谢您的回复!
Goodmorning all,
I'm currently playing with Datanucleus/JDO. One thing that I like is the Type safe query system, and I want to use Datanucleus in future projects (I come from Hibernate background).
I want to let the container (JBOSS 5) manage the transaction and I've defined a data source following the instructions from a datanucleus user (datanucleus forum thread), the only problem is that i cannot understand how to get a JDOPersistenceManager, all i get from a jndi lookup is the PersistenceManager, if I try a cast to JDOPersistenceManager i will get ClassCastException.
I need the JDOPersistenceManager to get a typesafe query...
My configuration is the same as the one explained in the thread..
Does someone encountered the same problem before?
And I wander also IF this thing would be possible at all...
Thank you for the replies!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从来没有时间在 JCA 下尝试它,所以没有明显的访问点来获取底层 JDOPersistenceManager ...但是,尝试这样的方法
,如果有效,那么您就有一个解决方法,直到我们在
JDOPersistenceManager 的 org.datanucleus.jdo.connector.PersistenceManagerImpl 类
Never had the time to try it under JCA so no obvious access point for getting the underlying JDOPersistenceManager ... however, try something like this
and if that works then you have a workaround until we provide an accessor in the
org.datanucleus.jdo.connector.PersistenceManagerImpl class for the JDOPersistenceManager