Hibernate Books

All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: Hibernate + PostgreSQL + LockMode.UPGRADE_NOWAIT
PostPosted: Fri May 11, 2012 6:09 pm 
Newbie

Joined: Fri May 11, 2012 5:58 pm
Posts: 1
I have a query that is fetching some data from a PostgreSQL database using LockMode.UPGRADE_NOWAIT. However, when Hibernate is unable to obtain a lock, because another process already has a pessimistic lock on the same row, instead of throwing a LockAcquisitionException, it actually waits for the lock. I looked at the PostgreSQLDialect and it does not correctly implement getForUpdateNoWaitString -- it delegates to getForUpdateString. I am using Hibernate 3.3.2 and PostgreSQL 9.1. It looks like Postgres supports NOWAIT [1], so why is the dialect not implementing it? I couldn't find any bugs on this, but can log one, if needed.

[1] http://www.postgresql.org/docs/9.1/stat ... elect.html

Edit: I just checked master on the Hibernate git repo, and it looks like this hasn't changed [2] (the implementation of the getForUpdateNoWaitString method lives in the Dialect class that delegates to getForUpdateString).

[2] https://github.com/hibernate/hibernate- ... alect.java


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 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.