-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to set nolock for a hibernate object using criteria?
PostPosted: Thu Mar 27, 2008 4:19 am 
Newbie

Joined: Thu Mar 27, 2008 3:47 am
Posts: 1
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: Hibernate 3.0

Mapping documents:

Code between sessionFactory.openSession() and session.close():

Full stack trace of any exception that occurs:

Name and version of the database you are using: MS SQL 2000

The generated SQL (show_sql=true):

Debug level Hibernate log excerpt:


Problems with Session and transaction handling?

Read this: http://hibernate.org/42.html

I use Hibernate criteria queries in my application to read data from tables. However I require data to be read from these tables with the "with nolock" feature of SQL. The idea is most of these read tables get updated by a batch process during the day and thus lock these tables for read during which the application is unable to read data. We are fine to do a dirty read for these tables without locking them from use. How can this be done


Top
 Profile  
 
 Post subject:
PostPosted: Thu Mar 27, 2008 5:22 am 
Regular
Regular

Joined: Mon Aug 06, 2007 10:49 am
Posts: 67
Location: Banska Bystrica, Slovakia
u can enable dirty read by this:

session.connection().setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);


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