-->
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: 'Like merge operation' in read only mode
PostPosted: Mon May 03, 2010 11:38 am 
Newbie

Joined: Mon May 03, 2010 11:00 am
Posts: 2
My apologizes for my English.

I have a web application where domain objects are passed to presentation layer as detached object.
The entity A has many eager loaded relations.

When an user want to update datas, an instance of A is saved to http session. The user send updates by several forms. When he decides to commit updates, session.saveOrUpdate is called on instance of A.

It works but requires many useless requests.

I thought I could use lazy loading with merge/evict operations to avoid useless requests.
My idea was the following :
- load an instance of A with least attributes using lazy loading. Cascade attribute is set to All for every relation.
- save the instance to http session
- when the user submits a form
+ set flush mode to MANUAL
+ merge instance
+ update my instance (even lazy loaded relations)
+ evict this instance
+ re set initial flush mode
- when the user commits updates
+ merge instance
+ run business validations process
+ commit session

But it does not work (see : http://opensource.atlassian.com/project ... l-tabpanel).

It is true that I don't really want to do a merge.
I need to rebind a modified transcient object to an hibernate session in order to access uninitialize relations. But I don't want the modifications to be flushed.

How can I do that?


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.