-->
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.  [ 2 posts ] 
Author Message
 Post subject: Database trigger increments version number
PostPosted: Fri May 27, 2005 3:12 pm 
Newbie

Joined: Sat Sep 06, 2003 9:29 pm
Posts: 6
Location: Minneapolis, MN
I’m currently working on a spike solution with an existing Oracle database. We are using Hibernate 3.0.5 for this spike solution effort. Database triggers have been created to manage the setting of the initial version number and the increment of that version number in INSERTs and UPDATEs, respectively. Obviously, this is not the ideal situation for Hibernate—Hibernate wants to manage the incrementing of the version number and keeping that version number synchronized between the object instance and the database row. What sort of strategies can we use in Hibernate to allow the increment to happen at the database, but have Hibernate correctly reflect that situation in the associated object instance? Would an Interceptor or the new event subsystem in Hibernate3 allow us to manage the version number appropriately?

Kind regards,

-- chris bartling –


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 28, 2005 12:52 am 
Regular
Regular

Joined: Tue May 24, 2005 10:19 am
Posts: 65
1)see http://www.hibernate.org/hib_docs/v3/reference/en/html_single/#transactions-optimistic-customizing
2)you can manage version in trigger code.
3)you can use interceptor


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.