sql server - Select Query Cause DeadLock -
we keep getting deadlock errors in our production environment. error message below in log file
2013-04-24 01:44:28,893 error [gk.lvl1executor-1] - transaction (process id 68) deadlocked on lock resources process , has been chosen deadlock victim. rerun transaction. 2013-04-24 01:44:28,906 error [gk.lvl1executor-1] - error in action org.hibernate.exception.lockacquisitionexception: not execute query
this error caused code:
transaction transaction = (transaction) session.createquery("from transaction tr " + "tr.transactionid = :transid , " + "tr.asexml.flowdirection = :flowdirection , " + "tr.asexml.header.to = :from , " + "tr.asexml.header.from = :to , " + "tr.asexml.header.market = :market , "+ "tr.asexml.header.transactiongroup = :trgroup") .setstring("transid", atransactionid) .setstring("flowdirection", aflowdirection) .setstring("from", aheader.getfrom()) .setstring("to", aheader.getto()) .setstring("market", aheader.getmarket()) .setstring("trgroup", aheader.gettransactiongroup()) .setfetchsize(1) .setmaxresults(1) .setcacheable(true) .uniqueresult();
it select query. don't know why cause deadlock. 1 more thing should metion isolation level set repeatable_read
.
Comments
Post a Comment