users@glassfish.java.net

Re: persistence-context-ref in ejb-jar.xml

From: <glassfish_at_javadesktop.org>
Date: Tue, 22 May 2007 09:36:27 PDT

>Does the ejb-jar contain an EJB component with ejb-name "midwood"?

No, I just put some name to fill out required element.
I did so because every EJB was already accessible anyway.
I didn't understand in first place why element <ejb-name/> is required :)

>Have you considered just using a @PersistenceUnit or @PersistenceContext annotation
>instead of declaring the dependency via .xml? It's much easier.

I started with JPA using this approach but now I need to use JNDI lookup because I have four databases (different locations) with the same structure. Also in future it will be more so I think it doesn't make sense to use annotation to point on persistence units.
That looks like hard coding for me.
Anyway your answers save me a day and I'm very thankful for your efforts.
I'd like to say that your answers not just correct but also very informative.

If by any chance you will be looking for some answers drop the line (vladperl at hotmail.com) I will make efforts to help :)

Best regards,
Vladimir
[Message sent by forum member 'vladperl' (vladperl)]

http://forums.java.net/jive/thread.jspa?messageID=218360