-->
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: lock and exception handling
PostPosted: Thu Nov 22, 2007 8:52 am 
Newbie

Joined: Mon Jan 30, 2006 12:51 pm
Posts: 1
We have next problems. Application access to few entities by timer from different application servers, and should update processing time. For removing concurrent problems we try to lock entity with getHibernateTemplate().lock(<entity>, LockMode.UPGRADE_NOWAIT) and handling exceptions CannotAcquireLockException and LockAcquisitionException. If there are no exceptions, we continue process entity and update processing time, if we don't lock entity, we skip it and try to process next enity. It's works, but JDBCExceptionReporter writes error to log if 2 applications from different application servers try to lock same entity. Example of processing one time event in both servers:
server 1 lock entity 1, server 2 write error,
server 1 lock entity 2, server 2 write error,
server 1 write error, server lock entity 3.

Also according to documentation if session throw exception we can't continue working with session.

Can anybody help to resolve this problems:
1. Remove error from log
2. Determinate what entity locked or not and lock if not locked in atomic operation without exception.


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.