-->
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: Setup hibernate config files for tables with NOLOCK
PostPosted: Wed Jun 28, 2006 5:05 pm 
Newbie

Joined: Wed Jun 28, 2006 4:34 pm
Posts: 2
Hello,

I am new to Hibernate. Can someone show the syntax to setup hibernate file to not lock a table when any particular SQL action is performed. For instance, if a table has 1 million records and the user requests all the rows, on the database backend I can see that the table has been locked.

In SQL Server, there is an option to avoid this from happening.

SELECT companyId, companyName, address
FROM dbo.Company (NOLOCK)

As you see (NOLOCK) tells the database not to establish a lock when the SELECT is performed.

Here is an example,

<hibernate-mapping schema="dbo">
<class name="com.project1.sturts.CompanyBean"
entity-name="Company" table="Company">

<property name="companyId" />
<property name="companyName" />
<property name="address" />

</class>
</hibernate-mapping>

Is there a way to set NOLOCK property in hibernate?


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.