-->
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: Hibernate exception -->make detached entities usable?
PostPosted: Mon Feb 13, 2006 6:57 am 
Senior
Senior

Joined: Tue Sep 13, 2005 2:01 am
Posts: 137
A web application using UserTransaction with Hibernate and JBoss EJB.

Users edit a detached entity(retrieved by Hibernate) directly through web. When applying changes, em.merge() is called, but a Hibernate exception raised. In this case, the detached entity is given back to user for correcting errors. But incorrect behavior occured. Either saying the detached entity is stale, or creating duplicate entity, or WrongClassException.

Is the detached entity re-usable after Hibernate exception occurs? Is there a way to make it re-usable? User does not want to lose his/her changes, and just want to correct errors.

If making a copy of the detached entity and giving the copy to user for editing, user can keep the change after hibernate exception. But deep copy is expensive. There are many types of entities, and implementation of deep copies is not trivial. I am looking for a way to keep detached entities usable even after Hibernate exception raised. Is there a way?

Any idea/help are appreciated.
Thanks in advance.


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.