-->
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: Having EntityManagers in different SLSB be "in sync&quo
PostPosted: Tue Dec 16, 2008 8:03 am 
Newbie

Joined: Sun Jun 17, 2007 7:04 am
Posts: 11
Hi there,
I am having a problem when working with entity managers in different stateless session beans in a same application.
I include them via injection:

Code:
@PersistenceContext(name="myPersistenceContext", unitName="mainPersistenceUnit")
   private EntityManager entityManager;


When working inside a transaction, if an entity manager adds or removes entities and before commiting, a method in another session bean ins invoked, even if its entity manager has the same name and unitName, it will not reflect the changes.
Is this the right behaviour of entity manager? How am I suppoused then to use only one entity manager or, at least, make these entity manager instances to be consistent with the others?

(Of course, not using transactions solves the problem as changes are commited when getting out of every method in the SLSB but I do need transactions here)

Thanks,
Ignacio


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.