-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: PersistenceContext Annotation
PostPosted: Thu Nov 05, 2009 6:05 am 
Beginner
Beginner

Joined: Thu Feb 22, 2007 6:08 am
Posts: 35
Hi there!

I have a problem on a project, where i want to implement conversation, but there is one thing i don't understand.

I have a EAR project. One of the projects concern to the EJB's, the other 2 concerns to the webapplication. This last 2 depends on the EJB project. On the EJB project i have several beans where i inject the Persistence Context like this:
Code:
@PersistenceContext
private EntityManager entityManager;

and it works fine.

My problem is that the session is local to that class and i want longer units of work with the same session to avoid the LazyInitializationException. On the classes of the projects that depends on the EJB's i can't inject the persistence context, the entityManager remains null. How can i inject the persistence context of a project wich is not he EJB project?

Thanks a lot!!

--Marco Santos, Portugal


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.