-->
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: How are you suppose to handle a session-scroped bean?
PostPosted: Wed May 09, 2012 9:31 am 
Newbie

Joined: Wed Apr 04, 2012 3:35 pm
Posts: 4
I'm working with JSF and this is starting to seem like a dead-end. I want to store objects from the a Hibernate-mapped class in session-scoped managed-bean class. The first step was to call this:

Code:
sessionFactory.getCurrentSession().buildLockRequest(LockOptions.NONE).lock(obj);


To avoid a LazyInitializationException and re-attach the object to the session whenever I needed to do something with it.

After that I've been getting "reassociated object has dirty collection" whenever I change a collection for an object and then try to access that object again. The only way around that was calling merge for the object. However that also resets all none-persistent properties of that object. I've Googled a lot for this but I can only seem to find confirmation that this is indeed the way it's suppose to be... Calling update, save, saveOrUpdate etc. that for object also still results in the same error.


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.