-->
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: EntityUpdateAction change 3.0 -> 3.1
PostPosted: Wed Jan 11, 2006 10:10 am 
Newbie

Joined: Wed Jan 11, 2006 10:05 am
Posts: 1
We are using Hibernate event model to implement transparent localization of POJOs. It is implemented as
PreUpdateEventListener and PostUpdateEventListener so that a POJO is manipulated at PreUpdateEventListener
before letting Hibernate to persist it. The original state is restored at PostUpdateEventListener so that subsequent snapshot comparisons match. This strategy works with Hibernate 3.0 but fails with 3.1. The reason for
failing with 3.1 is the addition of following code block:

Code:
                        // get the updated snapshot by cloning current state
                        // it is safe to copy in place, since by this time
                        // no-one else has a reference to the array
                        TypeFactory.deepCopy(
                                        state,
                                        persister.getPropertyTypes(),
                                        persister.getPropertyCheckability(),
                                        state,
                                        session
                                );


This happens before PostUpdateEventListener.onPostUpdate is called, so we do not have a chance to restore
the manipulated entity to its original state.

What is the rationale behind this added code block?
Is there any other way to implement the feature described above?

Thnx, Joni
Code:


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.