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?
|