Hibernate with MS SQL Server 2012 issue with table locks and parallel query

tanmally

I have a java thread that does the update of few tables in a transaction and there is another thread that reads the tables with read only transaction . The thread that reads the tables is waiting and not retuning the result and returns only after the other thread had done the update .

The case is different if DB is mysql where the update and query does happen parallel and no waiting . Am I missing something on MS SQL side . What needs to be done to make it parallel . Is this happening because of table locks in MS Sql Server .

The MS Sql server hibernate setting :

db.driverClassName = com.microsoft.sqlserver.jdbc.SQLServerDataSource

db.dialect = org.hibernate.dialect.SQLServer2008Dialect

Hibernate version : v4.3.6.Final

Connection pool : HikariCP-java6 - v2.2.5

null

in T-SQL you can use UNLOCK command, in this link you can see a full description of it. also you can use WITH (NOLOCK) while selecting from table like:

SELECT *
FROM sample_table WITH (NOLOCK)
WHERE --conditions

But in Hibernate with MS SQL Server I really don't know how to implement NOLOCK if you find a solution for it tell us I'll follow this question.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

SQL Query tuning - MS SQL Server -2012

From Dev

Truncate Vs Delete and Table Locks SQL Server 2012

From Dev

SQL Server 2012 - Two Table query

From Dev

How to copy table from MS SQL Server 2012 to MonetDB

From Dev

SQL Server 2012 Query

From Dev

SQL Server 2012 Performance Issue

From Dev

Update existing table with query results SQL Server 2012

From Dev

Update existing table with query results SQL Server 2012

From Dev

In MS Access SQL Server Linked Table pass through query

From Dev

Optimizing SQL Server 2012 Query

From Dev

SQL Server 2012 Query Confusion

From Dev

SQL Server 2012 LIMITing query

From Dev

Optimizing SQL Server 2012 Query

From Dev

SQL Server 2012 Query Confusion

From Dev

SQL Server 2012 query / Job

From Dev

Index for table in SQL Server 2012

From Dev

PHP Connection to MS SQL Server 2012

From Dev

MS-SQl Server 2012 for ubuntu

From Dev

Query with left join and count in select works in MySQL but not in MS SQL Server 2012

From Dev

Using ODBC in Access to connect to MS SQL Server 2012: huge time difference between calling query manually and in VBA

From Dev

Using ODBC in Access to connect to MS SQL Server 2012: huge time difference between calling query manually and in VBA

From Dev

Java Hibernate with SQL Server 2012 not working?

From Dev

Date conversion issue in SQL Server 2012

From Dev

RAISERROR issue since migration to SQL Server 2012

From Dev

Issue exporting from SQL Server 2012 to PostgreSQL

From Dev

Parsing/Conversion issue in sql server 2012?

From Dev

Try_convert issue * sql server 2012

From Dev

RAISERROR issue since migration to SQL Server 2012

From Dev

Sql Server 2012 left join issue

Related Related

HotTag

Archive