-->
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: Cheking for record lock
PostPosted: Sun Feb 08, 2009 10:47 am 
Newbie

Joined: Sun Feb 08, 2009 10:33 am
Posts: 2
Hi All,

I googled long time around, but can not find any answer for my Problem till now. Below is description of the problem:

I Locked a data record in my database with the hibernate method:

Code:
session.lock(element, LockMode.UPGRADE);


If I start my application twice the record is locked an can't be edited, but the application blocks while trying to set the lock a second time on the same DB record.
I don't know how to check if a db record is locked or not to send a message to the user and don't try to lock the record another time.

I tried the method:

Code:
session.getCurrentLockMode(element);


but it allways return LockMode.READ, when the record is locked or was never locked.

I hope you can help me.

I used MySQL as DBMS.

thanks


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.