This content has been marked as final.
Show 4 replies
-
1. Re: Accessing the EntityManager from a non-EJB class
kabirkhan Apr 17, 2005 5:10 PM (in response to ceracm)It is fine (apart from possible philosophical discussions :-)
Note that the spec mentions the EntityManager should be bound under java:comp/env/EntityManager. We are using java:comp.ejb3/env/EntityManage while waiting for the spec to be completed. -
2. Re: Accessing the EntityManager from a non-EJB class
ceracm Apr 17, 2005 5:35 PM (in response to ceracm)Thanks.
What theoretical discussions do you have in mind?
I think its reasonable for a non-EJB to call the EntityManager. For example, if you want to implement a DAO-like class that is called by the session bean.
It would be nice if a DAO could use dependency injection as well but I assume that it would be too inefficient to make the DAO a session bean as well. -
3. Re: Accessing the EntityManager from a non-EJB class
epbernard Apr 18, 2005 8:25 AM (in response to ceracm)"ceracm" wrote:
I assume that it would be too inefficient to make the DAO a session bean as well.
Why? -
4. Re: Accessing the EntityManager from a non-EJB class
ceracm Apr 18, 2005 11:16 AM (in response to ceracm)"epbernard" wrote:
"ceracm" wrote:
I assume that it would be too inefficient to make the DAO a session bean as well.
Why?
Thats a very good question.
One that is perhaps best answered by an application server developer
I would imagine that calling a session bean through a local interface from another session bean has some overhead.
But I suppose you could argue that the overhead of the is negligible compared to the work being done by the DAO.
Comments?