-->
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: How to set lock waiting time for session.get() with LockMode
PostPosted: Tue Jul 03, 2007 11:53 am 
Newbie

Joined: Tue Jul 03, 2007 11:35 am
Posts: 1
Hi,
We use Hibernate 3.1.1 and configure it with an Oracle DB:

<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="dialect">org.hibernate.dialect.Oracle9Dialect</property>
<property name="jdbc.batch_size">0</property>
<property name="connection.use_outer_join">false</property>
<property name="connection.datasource">jdbc.PDDB</property>
......

I have the following code to get the entity for update and like to specify the lock wait time so when the maximum waiting time is reached it will throw an Exception:

currOrder = (PDOrder) se.get(PDOrder.class, pdOrder.getComp_id(), LockMode.UPGRADE);

I do not want to use LockMode.UPGRADE_NOWAIT nor use LockMode.UPGRADE without the setting for maximum lock waiting time. But I have not found any solution to set the lock wait time for this. Also is there a way to specify the maximum lock time? If you have similar experience, please help! Any suggestion will be appreciated!


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.