-->
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.  [ 3 posts ] 
Author Message
 Post subject: Yet Another Locking Question - not getting the serialization
PostPosted: Fri Mar 05, 2004 12:50 am 
Newbie

Joined: Wed Jan 07, 2004 1:56 pm
Posts: 14
Hi,

Trying to work out exactly how the locking works with Hibernate & SQL Server.

I need a transaction isolation of REPEATABLE_READ - and effectively, I am trying to do a SELECT "FOR UPDATE".

Now, using raw JDBC (with my JDBC Driver, JSQL Connect) if I execute a PreparedStatement with ResultSet.CONCUR_UPDATABLE, and autoCommit=false then my SELECT statements are serialized on the table (which is what I want). This isnt driver specific, is it?

I am trying to achieve the same with Hibernate - but my SELECT's arent being serialized. In fact, on committing the Hibernate Transaction, one thread gets a transaction deadlock exception from JSQLConnect:
com.jnetdirect.jsql.m: Transaction (Process ID 52) was deadlocked on {lock} resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
at com.jnetdirect.jsql.af.a(Unknown Source)
... more

I have verified the Isolation Level is correct (on the underlying connection).

I have tried creating a Query and setting the LockMode to WRITE (and have verified the LockMode on the objects themselves) however, I am still not getting the serialization I am expecting.

What am I missing?

Thanks.

Cheers.
Nick


Top
 Profile  
 
 Post subject:
PostPosted: Fri Mar 05, 2004 2:55 pm 
Newbie

Joined: Wed Jan 07, 2004 1:56 pm
Posts: 14
Is this stuff in the doco?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 08, 2004 6:49 am 
Newbie

Joined: Wed Jan 07, 2004 1:56 pm
Posts: 14
anyone?


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