-->
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.  [ 4 posts ] 
Author Message
 Post subject: traking object updates
PostPosted: Sat Jun 26, 2004 4:52 pm 
Newbie

Joined: Mon Jan 12, 2004 5:46 pm
Posts: 8
Hi,

I have an application that synchronizes a set of objects between a server DB and mobile PDA DBs. I use hibernate for persistency. I need to implement some way of tagging an object with a unique 'stamp' on every change(database update) in order to be able to detect which objects must I send to the PDA. What is the best way of doing this?

I'm thinking of using an interceptor and in the onFlushDirty() to use a sequenceGenerator to generate a new unique 'stamp' if the object is changed. Is there a better way of doing this?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 28, 2004 12:34 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
The best and safiest way is using a trigger at the DB level

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 28, 2004 2:44 pm 
Newbie

Joined: Mon Jan 12, 2004 5:46 pm
Posts: 8
I forgot to tell you that I'm using a second level cache.
Wouldn't this be a problem in using triggers? How can I be sure that the value is properly read from DB after an update?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 28, 2004 3:47 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
You need that timestamp at the Java level?

You'll need to refresh() the object after the update occurs

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

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.