org.hibernate.exception.LockAcquisitionException: could not execute native bulk manipulation query


#1

The following is my method to update a row of records:

@Override
public void updateCurrentStatus(Long paymentHistoryId, String currentStatus) {
    StringBuilder sb = new StringBuilder( );
    sb.append( "update PaymentHistory SET " );
    sb.append( " currentStatus = :currentStatus ," );
    sb.append( " MODIFIEDDATETIME = CURRENT TIMESTAMP " );
    sb.append( "where paymentHistoryId = :paymentHistoryId " );

    final Query updateQuery = getSession( ).createSQLQuery( sb.toString( ) );
    updateQuery.setString( "currentStatus", currentStatus );
    updateQuery.setLong( "paymentHistoryId", paymentHistoryId );
    updateQuery.executeUpdate( );
}

PaymentHistory is an entity and paymentHistoryId is the primary key.

Thus, I believe my method will only update just ONE record of PaymentHistory table.

This process working fine so far. But yesterday I am hitting LockAcquisitionException. The error log will be as follow:

2018-01-16 19:56:15.379 [WebContainer : 657] ERROR c.c.i.c.a.a.ui.PaymentTrxAuthAction - [user1] - Encounter RuntimeException
org.hibernate.exception.LockAcquisitionException: could not execute native bulk manipulation query
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:105) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:198) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.impl.SessionImpl.executeNativeUpdate(SessionImpl.java:1190) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
    at org.hibernate.impl.SQLQueryImpl.executeUpdate(SQLQueryImpl.java:357) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
at com.cv.ibs.cib.customer.dao.impl.PaymentHistoryDAOImpl.updateCurrentStatus(PaymentHistoryDAOImpl.java:1069) ~[com.cv.ibs.cib.jar:na]
	at com.cv.ibs.cib.customer.service.impl.PaymentHistoryManagerImpl.updateCurrentStatus(PaymentHistoryManagerImpl.java:285) ~[com.cv.ibs.cib.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) ~[na:1.6.0]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) ~[na:1.6.0]
	at java.lang.reflect.Method.invoke(Method.java:611) ~[na:1.6.0]
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.transaction.interceptor.TransactionInterceptor$1.doInTransaction(TransactionInterceptor.java:132) ~[org.springframework.transaction-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.transaction.jta.WebSphereUowTransactionManager$UOWActionAdapter.run(WebSphereUowTransactionManager.java:337) ~[org.springframework.transaction-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderNewUOW(EmbeddableUOWManagerImpl.java:791) ~[com.ibm.ws.runtime.jar:na]
	at com.ibm.ws.uow.embeddable.EmbeddableUOWManagerImpl.runUnderUOW(EmbeddableUOWManagerImpl.java:370) ~[com.ibm.ws.runtime.jar:na]
	at org.springframework.transaction.jta.WebSphereUowTransactionManager.execute(WebSphereUowTransactionManager.java:281) ~[org.springframework.transaction-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:127) ~[org.springframework.transaction-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at com.sun.proxy.$Proxy141.updateCurrentStatus(Unknown Source) ~[na:na]
	at com.cv.ibs.module.workflow.payment.PaymentApprovalHandler.onPostApproved(PaymentApprovalHandler.java:339) ~[com.cv.ibs.module.workflow.impl.jar:na]
	at com.cv.ibs.module.workflow.service.impl.ApprovalServiceTrxControllerImpl.postProcessTask(ApprovalServiceTrxControllerImpl.java:101) ~[com.cv.ibs.module.workflow.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) ~[na:1.6.0]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) ~[na:1.6.0]
	at java.lang.reflect.Method.invoke(Method.java:611) ~[na:1.6.0]
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at com.sun.proxy.$Proxy135.postProcessTask(Unknown Source) ~[na:na]
	at com.cv.ibs.module.workflow.service.impl.ApprovalServiceImpl.performTask(ApprovalServiceImpl.java:242) ~[com.cv.ibs.module.workflow.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) ~[na:1.6.0]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) ~[na:1.6.0]
	at java.lang.reflect.Method.invoke(Method.java:611) ~[na:1.6.0]
	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:196) ~[org.springframework.aop-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at com.sun.proxy.$Proxy136.performTask(Unknown Source) ~[na:na]
	at com.cv.ibs.cib.app.authorization.command.ApprovalItemPerformTaskCommandHandler.execute(ApprovalItemPerformTaskCommandHandler.java:40) ~[com.cv.ibs.cib.jar:na]
	at com.cv.ibs.cib.app.authorization.command.ApprovalItemPerformTaskCommandHandler.execute(ApprovalItemPerformTaskCommandHandler.java:1) ~[com.cv.ibs.cib.jar:na]
	at com.cv.common.command.CommandExecutor.doExecute(CommandExecutor.java:50) ~[com.cv.common.jar:na]
	at com.cv.common.command.CommandExecutor.execute(CommandExecutor.java:44) ~[com.cv.common.jar:na]
	at com.cv.common.command.LocalCommandHandler.execute(LocalCommandHandler.java:46) ~[com.cv.common.jar:na]
	at com.cv.common.command.LocalCommandHandler.execute(LocalCommandHandler.java:1) ~[com.cv.common.jar:na]
	at com.cv.common.command.CommandTemplate.execute(CommandTemplate.java:33) ~[com.cv.common.jar:na]
	at com.cv.ibs.cib.app.authorization.ui.PaymentTrxAuthAction.executeApprove(PaymentTrxAuthAction.java:2442) [com.cv.ibs.cib.jar:na]
	at com.cv.ibs.cib.app.authorization.ui.PaymentTrxAuthAction.verifyOtp(PaymentTrxAuthAction.java:4257) [com.cv.ibs.cib.jar:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:60) ~[na:1.6.0]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37) ~[na:1.6.0]
	at java.lang.reflect.Method.invoke(Method.java:611) ~[na:1.6.0]
	at net.sourceforge.stripes.controller.DispatcherHelper$6.intercept(DispatcherHelper.java:442) [stripes-1.5_cv.jar:955]
	at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:158) [stripes-1.5_cv.jar:955]
	at com.cv.ibs.cib.common.ui.interceptor.JSTokenInterceptor.intercept(JSTokenInterceptor.java:60) [com.cv.ibs.cib.common.jar:na]
	at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) [stripes-1.5_cv.jar:955]
	at org.stripesstuff.plugin.session.SessionStoreInterceptor.intercept(SessionStoreInterceptor.java:52) [stripesstuff-0.1.jar:74M]
	at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) [stripes-1.5_cv.jar:955]
	at com.cv.ibs.cib.audit.ui.interceptor.BaseAuditLogInterceptor.intercept(BaseAuditLogInterceptor.java:109) [com.cv.ibs.cib.jar:na]
	at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) [stripes-1.5_cv.jar:955]
	at com.cv.ibs.cib.audit.ui.interceptor.BaseAuditLogInterceptor.intercept(BaseAuditLogInterceptor.java:109) [com.cv.ibs.cib.jar:na]
	at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) [stripes-1.5_cv.jar:955]
	at com.cv.ibs.cib.audit.ui.interceptor.BaseAuditLogInterceptor.intercept(BaseAuditLogInterceptor.java:109) [com.cv.ibs.cib.jar:na]
	at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) [stripes-1.5_cv.jar:955]
	at com.cv.ibs.cib.common.ui.interceptor.TokenInterceptor.intercept(TokenInterceptor.java:122) [com.cv.ibs.cib.common.jar:na]
	at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) [stripes-1.5_cv.jar:955]
	at net.sourceforge.stripes.controller.BeforeAfterMethodInterceptor.intercept(BeforeAfterMethodInterceptor.java:113) [stripes-1.5_cv.jar:955]
	at net.sourceforge.stripes.controller.ExecutionContext.proceed(ExecutionContext.java:155) [stripes-1.5_cv.jar:955]
	at net.sourceforge.stripes.controller.ExecutionContext.wrap(ExecutionContext.java:74) [stripes-1.5_cv.jar:955]
	at net.sourceforge.stripes.controller.DispatcherHelper.invokeEventHandler(DispatcherHelper.java:440) [stripes-1.5_cv.jar:955]
	at net.sourceforge.stripes.controller.DispatcherServlet.invokeEventHandler(DispatcherServlet.java:285) [stripes-1.5_cv.jar:955]
	at net.sourceforge.stripes.controller.DispatcherServlet.doPost(DispatcherServlet.java:167) [stripes-1.5_cv.jar:955]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:595) [javax.j2ee.servlet.jar:na]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:668) [javax.j2ee.servlet.jar:na]
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.invokeTarget(WebAppFilterChain.java:136) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:97) [com.ibm.ws.webcontainer.jar:na]
	at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:246) [stripes-1.5_cv.jar:955]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) [com.ibm.ws.webcontainer.jar:na]
	at net.sourceforge.stripes.controller.StripesFilter.doFilter(StripesFilter.java:246) [stripes-1.5_cv.jar:955]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) [com.ibm.ws.webcontainer.jar:na]
	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.obtainContent(SiteMeshFilter.java:129) [sitemesh-2.4.2.jar:na]
	at com.opensymphony.sitemesh.webapp.SiteMeshFilter.doFilter(SiteMeshFilter.java:77) [sitemesh-2.4.2.jar:na]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) [com.ibm.ws.webcontainer.jar:na]
	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:399) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.ui.SessionFixationProtectionFilter.doFilterHttp(SessionFixationProtectionFilter.java:67) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.ui.ExceptionTranslationFilter.doFilterHttp(ExceptionTranslationFilter.java:101) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.wrapper.SecurityContextHolderAwareRequestFilter.doFilterHttp(SecurityContextHolderAwareRequestFilter.java:91) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.ui.basicauth.BasicProcessingFilter.doFilterHttp(BasicProcessingFilter.java:174) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411) [spring-security-core-2.0.7.RELEASE.jar:na]
	at com.cv.ibs.cib.common.security.filter.AOBAuthenticationProcessFilter.doFilterHttp(AOBAuthenticationProcessFilter.java:99) [com.cv.ibs.cib.jar:na]
	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.ui.logout.LogoutFilter.doFilterHttp(LogoutFilter.java:89) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411) [spring-security-core-2.0.7.RELEASE.jar:na]
	at com.cv.ibs.cib.common.security.context.SecurityContextDetailsFilter.doFilterHttp(SecurityContextDetailsFilter.java:44) [com.cv.ibs.cib.jar:na]
	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:411) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:188) [spring-security-core-2.0.7.RELEASE.jar:na]
	at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:237) [org.springframework.web-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) [org.springframework.web-3.0.4.RELEASE.jar:3.0.4.RELEASE]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) [com.ibm.ws.webcontainer.jar:na]
	at com.cv.ibs.cib.common.ui.filter.MetaContextFactoryFilter.doFilter(MetaContextFactoryFilter.java:61) [com.cv.ibs.cib.jar:na]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) [com.ibm.ws.webcontainer.jar:na]
	at org.displaytag.filter.ResponseOverrideFilter.doFilter(ResponseOverrideFilter.java:125) [displaytag-1.2.jar:na]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) [com.ibm.ws.webcontainer.jar:na]
	at com.cv.common.web.filter.NoCacheFilter.doFilter(NoCacheFilter.java:65) [com.cv.common.jar:na]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) [com.ibm.ws.webcontainer.jar:na]
	at com.cv.common.web.filter.NoCacheFilter.doFilter(NoCacheFilter.java:65) [com.cv.common.jar:na]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) [com.ibm.ws.webcontainer.jar:na]
	at com.cv.ibs.cib.common.ui.filter.MDCInfoCaptureFilter.doFilter(MDCInfoCaptureFilter.java:92) [com.cv.ibs.cib.common.jar:na]
	at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:195) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:91) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:960) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1064) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:914) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200) [com.ibm.ws.webcontainer.jar:na]
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:461) [com.ibm.ws.runtime.jar:na]
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:528) [com.ibm.ws.runtime.jar:na]
	at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:314) [com.ibm.ws.runtime.jar:na]
	at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88) [com.ibm.ws.runtime.jar:na]
	at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818) [com.ibm.ws.runtime.jar:na]
	at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175) [com.ibm.ws.runtime.jar:na]
	at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217) [com.ibm.ws.runtime.jar:na]
	at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161) [com.ibm.ws.runtime.jar:na]
	at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138) [com.ibm.ws.runtime.jar:na]
	at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204) [com.ibm.ws.runtime.jar:na]
	at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775) [com.ibm.ws.runtime.jar:na]
	at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905) [com.ibm.ws.runtime.jar:na]
	at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1864) [com.ibm.ws.runtime.jar:na]
Caused by: com.ibm.db2.jcc.am.SqlTransactionRollbackException: DB2 SQL Error: SQLCODE=-911, SQLSTATE=40001, SQLERRMC=68, DRIVER=3.65.110
	at com.ibm.db2.jcc.am.cd.a(cd.java:685) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.am.cd.a(cd.java:60) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.am.cd.a(cd.java:127) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.am.ko.c(ko.java:2762) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.t4.bb.t(bb.java:988) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.t4.bb.l(bb.java:409) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.t4.bb.a(bb.java:61) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.t4.q.a(q.java:50) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.t4.sb.b(sb.java:220) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.am.lo.oc(lo.java:3416) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.am.lo.b(lo.java:4381) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.am.lo.gc(lo.java:783) ~[db2jcc.jar:na]
	at com.ibm.db2.jcc.am.lo.executeUpdate(lo.java:761) ~[db2jcc.jar:na]
	at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteUpdate(WSJdbcPreparedStatement.java:1187) ~[com.ibm.ws.runtime.jar:na]
	at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeUpdate(WSJdbcPreparedStatement.java:804) ~[com.ibm.ws.runtime.jar:na]
	at org.hibernate.engine.query.NativeSQLQueryPlan.performExecuteUpdate(NativeSQLQueryPlan.java:189) ~[hibernate-core-3.3.1.GA.jar:3.3.1.GA]
	... 157 common frames omitted

I am not understand why I hitting could not execute native bulk manipulation query Since I am only updating 1 row of records. I believe could not execute native bulk manipulation query is only happen when I update a bulk of records.

For org.hibernate.exception.LockAcquisitionException, I didnt see any request or thread that pulling this row of record or update this row of record. I believe LockAcquisitionException will only happen when the record is being update by another hibernate session, and I am still proceed to update it. But in my case, its not.

Any ideas why I getting this error?

Here is the log from DBA:


2018-01-17-12.32.11.071146+480 E341051933A666       LEVEL: Error

PID : 9699328 TID : 19792 PROC : db2sysc 0
INSTANCE: db2inst1 NODE : 000 DB : SDB
HOSTNAME: dbhm01.com
EDUID : 19792 EDUNAME: db2hadrp.0.1 (SDB) 0
FUNCTION: DB2 UDB, High Availability Disaster Recovery, hdrEduAcceptEvent, probe:20200
MESSAGE : Did not receive anything through HADR connection for the duration of
HADR_TIMEOUT. Closing connection.
DATA #1 : String, 30 bytes
hdrCurrentTime/hdrLastRecvTime
DATA #2 : unsigned integer, 4 bytes
1516163531
DATA #3 : unsigned integer, 4 bytes
1516163410


I do some study on this, but still not 100% understand on it. I am suspect the issue is cause by the network between application and database, or the database server is not stable. Any ideas?

Or any info I can get from this db log?

#2

I am not understand why I hitting could not execute native bulk manipulation query Since I am only updating 1 row of records. I believe could not execute native bulk manipulation query is only happen when I update a bulk of records.

It’s not related to Hibernate, but to the relational database. It could be that the row was modified by some other transaction and your UPDATE statement could not acquire the lock in a timely fashion.

More, your version of Hibernate is very old:

hibernate-core-3.3.1

You might want to upgrade to newer versions since a lot of stuff has changed since version 3.x.

Also, to understand exactly what happened, you need to add the entire stacktraace so we can see the original Exception that was converted by Hibernate to a LockAcquisitionException.


#3

Good day vlad,

I just add in the stack trace. Will think on your advice as well.