Hibernate StaleStateException happens when two threads read a record from database and simutaneously try to delete the same record, one of them deletes first and the second one throws StaleStateException as the record is not found. In this case the only alternative is to either ask the end user to retry the operation or handle the exception and retry the operation for few number of times.
for(int i=0;i<3 br="" i=""> try{
//Creating a session token
tokenEntity = securityManager.createSessionToken(printer, consumerKey);
break;
}catch(CpFaultException e){
Throwable t = e.getCause();
if(t!=null && (t instanceof OptimisticLockException || t instanceof EntityNotFoundException)){
continue;
}else{
throw e;
}
}
}3>
ERROR | 2014-04-15 23:42:08,876 | http-443-164 | [com.api.resources.device.SessionTokenRsource::handlePost_aroundBody0::107] An exception occurred. Please look at the stack trace: |
com.faultbarrier.CpFaultException: javax.persistence.OptimisticLockException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at com.faultbarrier.AbstractExceptionHandling.ajc$afterThrowing$com_hp_cloudprint_faultbarrier_AbstractExceptionHandling$1$5c51846b(AbstractExceptionHandling.aj:203) ~[util-3.13.7.29.jar:3.13.7.29]
at com.entities.dao.impl.SecurityDAOImpl.deleteObject(SecurityDAOImpl.java:86) ~[entities-3.13.7.29.jar:3.13.7.29]
at com.entities.dao.impl.SecurityDAOImpl.deleteSessionToken(SecurityDAOImpl.java:137) ~[entities-3.13.7.29.jar:3.13.7.29]
at sun.reflect.GeneratedMethodAccessor309.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_17]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_17]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) ~[spring-2.5.6.jar:2.5.6]
at $Proxy152.deleteSessionToken(Unknown Source) ~[na:na]
at com.security.impl.SecurityManagerImpl.createSessionToken(SecurityManagerImpl.java:172) ~[printer-3.13.7.29.jar:3.13.7.29]
at sun.reflect.GeneratedMethodAccessor294.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_17]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_17]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) ~[spring-2.5.6.jar:2.5.6]
at $Proxy153.createSessionToken(Unknown Source) ~[na:na]
at com.api.resources.device.SessionTokenRsource.handlePost_aroundBody0(SessionTokenRsource.java:93) [SessionTokenRsource.class:na]
at com.api.resources.device.SessionTokenRsource.handlePost_aroundBody1$advice(SessionTokenRsource.java:16) [SessionTokenRsource.class:na]
at com.api.resources.device.SessionTokenRsource.handlePost(SessionTokenRsource.java:40) [SessionTokenRsource.class:na]
at org.restlet.Finder.handle(Finder.java:357) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.doHandle(Filter.java:150) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.handle(Filter.java:195) [org.restlet-1.1.6.jar:na]
at org.restlet.Router.handle(Router.java:504) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.doHandle(Filter.java:150) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.handle(Filter.java:195) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.doHandle(Filter.java:150) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.handle(Filter.java:195) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.doHandle(Filter.java:150) [org.restlet-1.1.6.jar:na]
at com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:130) [com.noelios.restlet-1.1.6.jar:na]
at org.restlet.Filter.handle(Filter.java:195) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.doHandle(Filter.java:150) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.handle(Filter.java:195) [org.restlet-1.1.6.jar:na]
at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124) [com.noelios.restlet-1.1.6.jar:na]
at com.noelios.restlet.application.ApplicationHelper.handle(ApplicationHelper.java:112) [com.noelios.restlet-1.1.6.jar:na]
at org.restlet.Application.handle(Application.java:341) [org.restlet-1.1.6.jar:na]
at com.noelios.restlet.ext.servlet.ServletConverter.service(ServletConverter.java:199) [com.noelios.restlet.ext.servlet-1.1.6.jar:na]
at com.util.servlet.RestletFrameworkServlet.doService(RestletFrameworkServlet.java:44) [util-3.13.7.29.jar:3.13.7.29]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) [spring-webmvc-2.5.6.jar:2.5.6]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511) [spring-webmvc-2.5.6.jar:2.5.6]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) [servlet-api.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.4.jar:2.0.4]
at com.api.security.ConsumerKeyProtectedResourceProcessingFilter.onValidSignature(ConsumerKeyProtectedResourceProcessingFilter.java:51) [ConsumerKeyProtectedResourceProcessingFilter.class:na]
at org.springframework.security.oauth.provider.OAuthProviderProcessingFilter.doFilter(OAuthProviderProcessingFilter.java:159) [spring-security-oauth-3.9.jar:na]
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.securechannel.ChannelProcessingFilter.doFilterHttp(ChannelProcessingFilter.java:116) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) [spring-2.5.6.jar:2.5.6]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) [spring-2.5.6.jar:2.5.6]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
at com.eprintdirectory.util.ShardCleanupFilter.doFilter(ShardCleanupFilter.java:30) [eprintDirectory-3.13.7.29.jar:3.13.7.29]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
at com.metrics.MetricsUpdationFilter.doFilter(MetricsUpdationFilter.java:34) [metrics-3.13.7.29.jar:3.13.7.29]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:na]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:na]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:na]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina.jar:na]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555) [catalina.jar:na]
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:600) [catalina.jar:na]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:na]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) [catalina.jar:na]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) [tomcat-coyote.jar:na]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) [tomcat-coyote.jar:na]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) [tomcat-coyote.jar:na]
at java.lang.Thread.run(Thread.java:619) [na:1.6.0_17]
Caused by: javax.persistence.OptimisticLockException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:654) ~[hibernate-entitymanager-3.3.1.ga.jar:na]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:600) ~[hibernate-entitymanager-3.3.1.ga.jar:na]
at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:300) ~[hibernate-entitymanager-3.3.1.ga.jar:na]
at sun.reflect.GeneratedMethodAccessor237.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_17]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_17]
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:198) ~[spring-2.5.6.jar:2.5.6]
at $Proxy114.flush(Unknown Source) ~[na:na]
at com.entities.dao.impl.SecurityDAOImpl.deleteObject(SecurityDAOImpl.java:85) ~[entities-3.13.7.29.jar:3.13.7.29]
.. 81 common frames omitted
Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:297) ~[hibernate-entitymanager-3.3.1.ga.jar:na]
.. 87 common frames omitted
for(int i=0;i<3 br="" i=""> try{
//Creating a session token
tokenEntity = securityManager.createSessionToken(printer, consumerKey);
break;
}catch(CpFaultException e){
Throwable t = e.getCause();
if(t!=null && (t instanceof OptimisticLockException || t instanceof EntityNotFoundException)){
continue;
}else{
throw e;
}
}
}3>
ERROR | 2014-04-15 23:42:08,876 | http-443-164 | [com.api.resources.device.SessionTokenRsource::handlePost_aroundBody0::107] An exception occurred. Please look at the stack trace: |
com.faultbarrier.CpFaultException: javax.persistence.OptimisticLockException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at com.faultbarrier.AbstractExceptionHandling.ajc$afterThrowing$com_hp_cloudprint_faultbarrier_AbstractExceptionHandling$1$5c51846b(AbstractExceptionHandling.aj:203) ~[util-3.13.7.29.jar:3.13.7.29]
at com.entities.dao.impl.SecurityDAOImpl.deleteObject(SecurityDAOImpl.java:86) ~[entities-3.13.7.29.jar:3.13.7.29]
at com.entities.dao.impl.SecurityDAOImpl.deleteSessionToken(SecurityDAOImpl.java:137) ~[entities-3.13.7.29.jar:3.13.7.29]
at sun.reflect.GeneratedMethodAccessor309.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_17]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_17]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:198) ~[spring-2.5.6.jar:2.5.6]
at $Proxy152.deleteSessionToken(Unknown Source) ~[na:na]
at com.security.impl.SecurityManagerImpl.createSessionToken(SecurityManagerImpl.java:172) ~[printer-3.13.7.29.jar:3.13.7.29]
at sun.reflect.GeneratedMethodAccessor294.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_17]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_17]
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) ~[spring-2.5.6.jar:2.5.6]
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) ~[spring-2.5.6.jar:2.5.6]
at $Proxy153.createSessionToken(Unknown Source) ~[na:na]
at com.api.resources.device.SessionTokenRsource.handlePost_aroundBody0(SessionTokenRsource.java:93) [SessionTokenRsource.class:na]
at com.api.resources.device.SessionTokenRsource.handlePost_aroundBody1$advice(SessionTokenRsource.java:16) [SessionTokenRsource.class:na]
at com.api.resources.device.SessionTokenRsource.handlePost(SessionTokenRsource.java:40) [SessionTokenRsource.class:na]
at org.restlet.Finder.handle(Finder.java:357) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.doHandle(Filter.java:150) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.handle(Filter.java:195) [org.restlet-1.1.6.jar:na]
at org.restlet.Router.handle(Router.java:504) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.doHandle(Filter.java:150) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.handle(Filter.java:195) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.doHandle(Filter.java:150) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.handle(Filter.java:195) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.doHandle(Filter.java:150) [org.restlet-1.1.6.jar:na]
at com.noelios.restlet.StatusFilter.doHandle(StatusFilter.java:130) [com.noelios.restlet-1.1.6.jar:na]
at org.restlet.Filter.handle(Filter.java:195) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.doHandle(Filter.java:150) [org.restlet-1.1.6.jar:na]
at org.restlet.Filter.handle(Filter.java:195) [org.restlet-1.1.6.jar:na]
at com.noelios.restlet.ChainHelper.handle(ChainHelper.java:124) [com.noelios.restlet-1.1.6.jar:na]
at com.noelios.restlet.application.ApplicationHelper.handle(ApplicationHelper.java:112) [com.noelios.restlet-1.1.6.jar:na]
at org.restlet.Application.handle(Application.java:341) [org.restlet-1.1.6.jar:na]
at com.noelios.restlet.ext.servlet.ServletConverter.service(ServletConverter.java:199) [com.noelios.restlet.ext.servlet-1.1.6.jar:na]
at com.util.servlet.RestletFrameworkServlet.doService(RestletFrameworkServlet.java:44) [util-3.13.7.29.jar:3.13.7.29]
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571) [spring-webmvc-2.5.6.jar:2.5.6]
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511) [spring-webmvc-2.5.6.jar:2.5.6]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637) [servlet-api.jar:na]
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) [servlet-api.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) [catalina.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:378) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.intercept.web.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.intercept.web.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.4.jar:2.0.4]
at com.api.security.ConsumerKeyProtectedResourceProcessingFilter.onValidSignature(ConsumerKeyProtectedResourceProcessingFilter.java:51) [ConsumerKeyProtectedResourceProcessingFilter.class:na]
at org.springframework.security.oauth.provider.OAuthProviderProcessingFilter.doFilter(OAuthProviderProcessingFilter.java:159) [spring-security-oauth-3.9.jar:na]
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.context.HttpSessionContextIntegrationFilter.doFilterHttp(HttpSessionContextIntegrationFilter.java:235) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.securechannel.ChannelProcessingFilter.doFilterHttp(ChannelProcessingFilter.java:116) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.ui.SpringSecurityFilter.doFilter(SpringSecurityFilter.java:53) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.util.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:390) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.security.util.FilterChainProxy.doFilter(FilterChainProxy.java:175) [spring-security-core-2.0.4.jar:2.0.4]
at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:236) [spring-2.5.6.jar:2.5.6]
at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:167) [spring-2.5.6.jar:2.5.6]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
at com.eprintdirectory.util.ShardCleanupFilter.doFilter(ShardCleanupFilter.java:30) [eprintDirectory-3.13.7.29.jar:3.13.7.29]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
at com.metrics.MetricsUpdationFilter.doFilter(MetricsUpdationFilter.java:34) [metrics-3.13.7.29.jar:3.13.7.29]
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) [catalina.jar:na]
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) [catalina.jar:na]
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) [catalina.jar:na]
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) [catalina.jar:na]
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:555) [catalina.jar:na]
at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:600) [catalina.jar:na]
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:na]
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) [catalina.jar:na]
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:852) [tomcat-coyote.jar:na]
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) [tomcat-coyote.jar:na]
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) [tomcat-coyote.jar:na]
at java.lang.Thread.run(Thread.java:619) [na:1.6.0_17]
Caused by: javax.persistence.OptimisticLockException: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.ejb.AbstractEntityManagerImpl.wrapStaleStateException(AbstractEntityManagerImpl.java:654) ~[hibernate-entitymanager-3.3.1.ga.jar:na]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:600) ~[hibernate-entitymanager-3.3.1.ga.jar:na]
at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:300) ~[hibernate-entitymanager-3.3.1.ga.jar:na]
at sun.reflect.GeneratedMethodAccessor237.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_17]
at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_17]
at org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:198) ~[spring-2.5.6.jar:2.5.6]
at $Proxy114.flush(Unknown Source) ~[na:na]
at com.entities.dao.impl.SecurityDAOImpl.deleteObject(SecurityDAOImpl.java:85) ~[entities-3.13.7.29.jar:3.13.7.29]
.. 81 common frames omitted
Caused by: org.hibernate.StaleStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.hibernate.jdbc.Expectations$BasicExpectation.checkBatched(Expectations.java:61) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.jdbc.Expectations$BasicExpectation.verifyOutcome(Expectations.java:46) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.jdbc.BatchingBatcher.checkRowCounts(BatchingBatcher.java:68) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.jdbc.BatchingBatcher.doExecuteBatch(BatchingBatcher.java:48) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.jdbc.AbstractBatcher.executeBatch(AbstractBatcher.java:242) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:235) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:144) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000) ~[hibernate-3.2.2.ga.jar:3.2.2.ga]
at org.hibernate.ejb.AbstractEntityManagerImpl.flush(AbstractEntityManagerImpl.java:297) ~[hibernate-entitymanager-3.3.1.ga.jar:na]
.. 87 common frames omitted
No comments:
Post a Comment