-->
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: Temporarily disable optimistic locking?
PostPosted: Fri Mar 10, 2006 3:26 am 
Newbie

Joined: Mon Mar 21, 2005 12:27 am
Posts: 17
Hi,

We have a certain background daemon which will use Lucene to index some records being updated. To prevent re-indexing records that have not been changed, the daemon will update a "lastIndexedAt" field after the record is indexed.

The data record classes are applying Hibernate's optimistic version-stamp locking. This frequently causes StaleObjectException at either the daemon or the main operation server because record's version has ben updated by either side.

Because this "lastIndexedAt" field are not used for other purpose and it is not essential for it be to absolutely transaction-safe, we believe the index daemon can just use pessemistic locking to update this particular field without changing the version stamp at the same time.

However, I have not found a call that seem to temporarily disable the version stamp update.

Alternatively, we can acquire the SQL connection and emit SQL statement like

update r.lastIndexedAt = {} from <ClassTbl> where ...

This would work but we must first figure out the table name which is made complicate due to our use of multi-table inheritance mapping.

We hope someone can point us the simplest possible way to update this simple field without updating the version field.

Thanks

_________________
Hacking Bear


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.