Deadlock situation - TechRepublic
Question
January 31, 2008 at 11:57 PM
dominicmdsouza

Deadlock situation

by dominicmdsouza . Updated 18 years, 5 months ago

Hi,

I am using hibernate 3 and MS Sql Server 2005 with jtds 1.2 driver. i am getting a deadlock exception in the server logs if i perform a Load Test with multiple users.
*******************************************
ERROR LOGS:
*******************************************
org.hibernate.exception.LockAcquisitionException: could not execute query
at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:82)
at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
at org.hibernate.loader.Loader.doList(Loader.java:2223)
at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2104)
at org.hibernate.loader.Loader.list(Loader.java:2099)
at org.hibernate.loader.criteria.CriteriaLoader.list(CriteriaLoader.java:94)
at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1569)
at org.hibernate.impl.CriteriaImpl.list(CriteriaImpl.java:283)
at org.hibernate.impl.CriteriaImpl$Subcriteria.list(CriteriaImpl.java:458)
at tavant.app.iciciprudential.common.utils.HibernateUtil.getAppByContractNumber(HibernateUtil.java:76)
at tavant.app.iciciprudential.business.Wrapper.retrieveUnderWritingAppByContractNumber(Wrapper.java:171)
at tavant.app.iciciprudential.integration.ejb.session.BREIntegrationBean.submitURMSApplication(BREIntegrationBean.java:173)
at com.pramati.ejb.runtime.BREIntegrationLocalImpl_1375550924._pramati_impl_submitURMSApplication(BREIntegrationLocalImpl_1375550924.java:620)
at com.pramati.ejb.runtime.BREIntegrationLocalImpl_1375550924$6.run(BREIntegrationLocalImpl_1375550924.java:567)
at com.pramati.security.util.PramatiSecurityHelper._doAs(PramatiSecurityHelper.java:54)
at com.pramati.security.util.AbstractSecurityHelper._doAs(AbstractSecurityHelper.java:195)
at com.pramati.services.security.spi.SecurityHelper.doAs(SecurityHelper.java:144)
at com.pramati.ejb.runtime.BREIntegrationLocalImpl_1375550924.__pramati_wrapper_submitURMSApplication(BREIntegrationLocalImpl_1375550924.java:562)
at com.pramati.ejb.runtime.BREIntegrationImpl_1375550924.submitURMSApplication(BREIntegrationImpl_1375550924.java:262)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.pramati.util.rmi.proxy.LocalMethodInvocationHandler.invoke(LocalMethodInvocationHandler.java:81)
at $Proxy41.submitURMSApplication(Unknown Source)
at com.tavant.app.icicipru.biz.service.impl.URMSIntegrationMgrImpl.performUnderwriting(URMSIntegrationMgrImpl.java:81)
at com.tavant.app.icicipru.biz.service.UWAppServiceMgr.processUnderwrite(UWAppServiceMgr.java:485)
at com.tavant.app.icicipru.biz.session.UWAppSessionBean.processUnderwrite(UWAppSessionBean.java:529)
at com.pramati.ejb.runtime.UWAppSessionLocalImpl_1048713847._pramati_impl_processUnderwrite(UWAppSessionLocalImpl_1048713847.java:2531)
at com.pramati.ejb.runtime.UWAppSessionLocalImpl_1048713847$25.run(UWAppSessionLocalImpl_1048713847.java:2475)
at com.pramati.security.util.PramatiSecurityHelper._doAs(PramatiSecurityHelper.java:54)
at com.pramati.security.util.AbstractSecurityHelper._doAs(AbstractSecurityHelper.java:195)
at com.pramati.services.security.spi.SecurityHelper.doAs(SecurityHelper.java:144)
at com.pramati.ejb.runtime.UWAppSessionLocalImpl_1048713847.__pramati_wrapper_processUnderwrite(UWAppSessionLocalImpl_1048713847.java:2470)
at com.pramati.ejb.runtime.UWAppSessionImpl_1048713847.processUnderwrite(UWAppSessionImpl_1048713847.java:975)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.pramati.util.rmi.proxy.LocalMethodInvocationHandler.invoke(LocalMethodInvocationHandler.java:81)
at $Proxy30.processUnderwrite(Unknown Source)
at com.tavant.app.icicipru.delegate.DedupDelegate.processUnderwrite(DedupDelegate.java:59)
at com.tavant.app.icicipru.action.DedupAction$UnderWritingThread.run(DedupAction.java:171)
at com.tavant.app.icicipru.action.DedupAction.underwrite(DedupAction.java:148)
at com.tavant.app.icicipru.action.DedupAction.view(DedupAction.java:82)
at sun.reflect.GeneratedMethodAccessor1008.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:269)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:170)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:449)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at com.pramati.web.servlet.core.ServiceAction.run(ServiceAction.java:83)
at com.pramati.security.util.PramatiSecurityHelper._doAs(PramatiSecurityHelper.java:54)
at com.pramati.security.util.AbstractSecurityHelper._doAs(AbstractSecurityHelper.java:195)
at com.pramati.services.security.spi.SecurityHelper.doAs(SecurityHelper.java:144)
at com.pramati.web.servlet.core.PramatiFilterChainImpl.invokeTargetWebResource(PramatiFilterChainImpl.java:320)
at com.pramati.web.servlet.core.PramatiFilterChainImpl.doFilter(PramatiFilterChainImpl.java:164)
at com.pramati.web.servlet.core.PramatiFilterChainImpl.startDoFilter(PramatiFilterChainImpl.java:115)
at com.pramati.web.interceptors.ServiceInterceptor.preProcess(ServiceInterceptor.java:113)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:65)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultInterceptor.process(DefaultInterceptor.java:66)
at com.pramati.web.interceptors.core.InterceptorChainImpl.processNext(InterceptorChainImpl.java:48)
at com.pramati.web.interceptors.core.DefaultProcessContainer.process(DefaultProcessContainer.java:97)
at com.pramati.web.core.WorkerThread.processConnection(WorkerThread.java:286)
at com.pramati.web.core.WorkerThread.processConnection(WorkerThread.java:262)
at com.pramati.web.core.WorkerThread.run(WorkerThread.java:128)
Caused by: java.sql.SQLException: Transaction (Process ID 60) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
at net.sourceforge.jtds.jdbc.SQLDiagnostic.addDiagnostic(SQLDiagnostic.java:365)
at net.sourceforge.jtds.jdbc.TdsCore.tdsErrorToken(TdsCore.java:2781)
at net.sourceforge.jtds.jdbc.TdsCore.nextToken(TdsCore.java:2224)
at net.sourceforge.jtds.jdbc.TdsCore.getNextRow(TdsCore.java:761)
at net.sourceforge.jtds.jdbc.JtdsResultSet.next(JtdsResultSet.java:593)
at org.hibernate.loader.Loader.doQuery(Loader.java:697)
at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:236)
at org.hibernate.loader.Loader.doList(Loader.java:2220)
… 77 more
*******************************************

This discussion is locked

All Comments