English 中文(简体)
集装箱与JDO/DataNucleus
原标题:Container Managed Transaction with JDO/DataNucleus

所有人,

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...

感谢您的答复!

最佳回答

从来没有时间根据《刑法》进行审判,因此没有明显的进入点来让潜在的“JDOPersistenceManager......”尝试像这样的东西。

JDOPersistenceManager jdopm = 
    ((JDOTransaction)pm.getCurrentTransaction()).getPersistenceManager();

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

问题回答

暂无回答




相关问题
Webspehere 6.1 and JNDI for something other than a Datasource

I was wondering: how does one go about configuring WAS if they want to store some confidential information that is not datasource, JMS or Mail related? I m looking more for an adhoc JNDI resource (a ...

JBoss JNDI Binding Manager - maximum length of value?

I m using the technique described here to register string values on the JNDI tree via an XML file deployed to JBoss. This is working fine for my system constants (URLs and the like). However I am ...

How to configure JPA to use JNDI?

I have a working persistence definition that works on java level tests. Now I want to incorporate that into a web application which defines the database connection as JNDI in the context.xml. What do ...

Jetty JNDI Java Mail

I am using Jetty 7 with JBoss Seam and have 2 Java Mail Sessions configured, one for support notifications and another for general notifications. The problem I am having appears to be from JBoss Seam ...

Using JNDI for Database connections

This might sound like a noob question but this is the first time I m treading into Database territory. From here I got the info that The most efficient way to implement communication between the ...

JNDI Names -- Is Prefix "jdbc/" needed?

What s up with JNDI names? I m trying to get a javax.sql.DataSource using the new annotations feature of Java 5. It s not working for me, so I want to ask... I have a in my web.xml, inside of it is ...

热门标签