On Dec 5, 2006, at 11:49 AM, David Jencks wrote:


On Dec 5, 2006, at 11:01 AM, David Blevins wrote:


On Dec 5, 2006, at 10:47 AM, David Jencks wrote:


On Dec 3, 2006, at 4:11 PM, David Blevins wrote:


On Dec 3, 2006, at 1:53 PM, Manu George wrote:

Hi David B ,
I got it working i.e am able to get the EntityManagerFactory from JNDI. In the persistence.xml I have to give the jta datasource as java:openejb/connector/Default JDBC Database for the default datasource
Is this approach acceptable? Or should it be in the
java:comp/env/jdbc/datasource format?

Excellent! That's a great first run. It is supposed to be of the java:comp/env variety,

I disagree. As I understand it, the jpa EMF is something you configure in the server, not per ejb. Thus the datasource it uses should not change depending on which ejb happens to be using it.

Took a closer look at the tck and it looks like you're right. I assume then that the way you specify a global data source name is vendor specific and no spec defined?

That's right! seems a little odd to me, but it's specifically container dependent. In g. I'm using an abstract name query, which typically means "name=MyDataSource"

Huh, had I been completely aware of that during the ejb3 expert group I could have used that as an additional argument for my proposed app- based JNDI ENC (i.e. being able to configure a JNDI tree for a whole ejb-jar like you can for servlets). Maybe for EJB 3.1.

On the same note was the code that creates EMFs in openejb3 useful when you created the one in geronimo/openejb2? Hope there was something in there you could reuse.

Yes, it was very helpful. One piece that is still missing from the deployer code is the part that looks around for any stray persistence.xml files you might have hidden in your app. Do I recall correctly that you have some code that does this? You might even have offered to put that code in the g. deployer, but a pointer to it would also be great :-)

No need to offer what's already yours :)  You want the ResourceFinder:

http://svn.apache.org/repos/asf/geronimo/xbean/trunk/xbean-finder/ src/main/java/org/apache/xbean/finder/ResourceFinder.java

Originally written by me in OpenEJB and moved into XBean around JavaOne. Check out the ResourceFinderTest.testUrlConstructor(). Though, I have been wanting to do something like in ClassFinder in ResourceFinder, namely being able to say 'search this classloader, but not the parent classloader' or 'search this classloader and parent classloaders up until this particular parent classloader'. But you can essentially get that same result with some work passing in the URLs you want to search.

Anyway, if it turns out your more after then classloader "range" type of thing rather than the explicit URL list searching, just let me know cause I've been looking for a reason to plumb that in.

-David

Reply via email to