optimistic locking failed
Asked by Sorash Ali Hassan:

Hi,

I'm getting an optimistic locking failed; nested exception error. See cause below.

Can you advise?

Sorash

### Cause {#toc-hId-1055037519}

org.springframework.orm.hibernate.HibernateOptimisticLockingFailureException: Object of class \[java.lang.Object\] with identifier \[null\]: optimistic locking failed; nested exception is net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update \[0\]; actual row count: -1; expected: 1  
at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:593)

caused by: net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update \[0\]; actual row count: -1; expected: 1  
at org.hibernate.internal.ExceptionConverterImpl.wrapStaleStateException(ExceptionConverterImpl.java:212)


Answers:
author: Shannon S
body: Sorash,

I just have a few questions for you:

1. Can you let me know what you were doing when you received the error?
2. If you're editing a page, was it when another user was trying to edit at the same time?
3. Can you replicate the issue at this time?
4. Lastly, what version of Confluence are you on?

Thank you for your help!

Regards,

Shannon

comments: author: Sorash Ali Hassan
body: HI Shannon,

1. I was trying to log into Confluence

2. I was not editing a page.

3. I can replicate the issue

4. The version of confluence is 6.12.0

I hope that helps.

Sorash


author: Shannon S
body: Sorash,

Could you let me know how your user management is set up then?

It will also help if you can trigger the error again while tailing your Confluence Server Logs. They should show us more information than the UI has.

Regards,

Shannon


author: Sorash Ali Hassan
body: HI Shannon,

I'm not able to login to confluence so I'm not able to share anything. I'm hoping this can be resolved.

Sorash


author: Shannon S
body: Sorash,

It's not required for you to login to Confluence to obtain the server logs. Please attempt to login again while you are tailing the Server logs located on your server according to this article:

* [Working with Confluence Logs](https://confluence.atlassian.com/doc/working-with-confluence-logs-108364721.html)

As for your User Management, can you tell me if you're using Confluence internal user management, Jira User Management, or something like LDAP, AD? Essentially, what source are you using to manage your Confluence userbase?

Regards,

Shannon


author: Sorash Ali Hassan
body: The following is the server log:

<br />

2019-03-13 21:54:25 Commons Daemon procrun stderr initialized  
13-Mar-2019 21:54:27.340 WARNING \[main\] org.apache.tomcat.util.digester.SetPropertiesRule.begin \[SetPropertiesRule\]{Server} Setting property 'debug' to '0' did not find a matching property.  
13-Mar-2019 21:54:27.527 WARNING \[main\] org.apache.catalina.startup.SetAllPropertiesRule.begin \[SetAllPropertiesRule\]{Server/Service/Connector} Setting property 'debug' to '0' did not find a matching property.  
13-Mar-2019 21:54:27.824 WARNING \[main\] org.apache.tomcat.util.digester.SetPropertiesRule.begin \[SetPropertiesRule\]{Server/Service/Engine} Setting property 'debug' to '0' did not find a matching property.  
13-Mar-2019 21:54:27.824 WARNING \[main\] org.apache.tomcat.util.digester.SetPropertiesRule.begin \[SetPropertiesRule\]{Server/Service/Engine/Host} Setting property 'debug' to '0' did not find a matching property.  
13-Mar-2019 21:54:27.949 WARNING \[main\] org.apache.tomcat.util.digester.SetPropertiesRule.begin \[SetPropertiesRule\]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.  
13-Mar-2019 21:54:28.012 WARNING \[main\] org.apache.catalina.core.StandardContext.setPath A context path must either be an empty string or start with a '/' and do not end with a '/'. The path \[${confluence.context.path}/synchrony-proxy\] does not meet these criteria and has been changed to \[/${confluence.context.path}/synchrony-proxy\]  
13-Mar-2019 21:54:28.012 WARNING \[main\] org.apache.tomcat.util.digester.SetPropertiesRule.begin \[SetPropertiesRule\]{Server/Service/Engine/Host/Context} Setting property 'debug' to '0' did not find a matching property.  
13-Mar-2019 21:54:28.809 INFO \[main\] org.apache.coyote.AbstractProtocol.init Initializing ProtocolHandler \["http-nio-8092"\]  
13-Mar-2019 21:54:29.043 INFO \[main\] org.apache.tomcat.util.net.NioSelectorPool.getSharedSelector Using a shared selector for servlet write/read  
13-Mar-2019 21:54:29.059 INFO \[main\] org.apache.catalina.startup.Catalina.load Initialization processed in 2093 ms  
13-Mar-2019 21:54:29.074 INFO \[main\] org.apache.catalina.core.StandardService.startInternal Starting service \[Tomcat-Standalone\]  
13-Mar-2019 21:54:29.074 INFO \[main\] org.apache.catalina.core.StandardEngine.startInternal Starting Servlet Engine: Apache Tomcat/9.0.11  
13-Mar-2019 21:54:32.933 INFO \[localhost-startStop-2\] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.  
13-Mar-2019 21:54:33.449 INFO \[localhost-startStop-2\] org.apache.catalina.core.ApplicationContext.log Spring WebApplicationInitializers detected on classpath: \[com.atlassian.synchrony.proxy.SynchronyDispatcherServletInitializer@318f7565\]  
13-Mar-2019 21:54:33.761 INFO \[localhost-startStop-2\] org.apache.catalina.core.ApplicationContext.log Initializing Spring FrameworkServlet 'dispatcher'  
13-Mar-2019 21:54:33.761 INFO \[localhost-startStop-2\] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization started  
13-Mar-2019 21:54:33.777 INFO \[localhost-startStop-2\] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.prepareRefresh Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date \[Wed Mar 13 21:54:33 AEDT 2019\]; root of context hierarchy  
13-Mar-2019 21:54:33.855 INFO \[localhost-startStop-2\] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.loadBeanDefinitions Registering annotated classes: \[class com.atlassian.synchrony.proxy.websocket.WebSocketConfig,class com.atlassian.synchrony.proxy.web.SynchronyWebMvcConfig\]  
13-Mar-2019 21:54:34.605 INFO \[localhost-startStop-2\] org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler.initialize Initializing ExecutorService 'defaultSockJsTaskScheduler'  
13-Mar-2019 21:54:34.683 INFO \[localhost-startStop-2\] org.springframework.web.socket.server.support.WebSocketHandlerMapping.registerHandler Mapped URL path \[/v1/bayeux-sync1\] onto handler of type \[class org.springframework.web.socket.server.support.WebSocketHttpRequestHandler\]  
13-Mar-2019 21:54:34.933 INFO \[localhost-startStop-2\] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.register Mapped "{\[/healthcheck\]}" onto public com.atlassian.synchrony.proxy.web.HealthCheckResult com.atlassian.synchrony.proxy.web.SynchronyProxyRestController.getSynchronyProxyInfo()  
13-Mar-2019 21:54:34.949 INFO \[localhost-startStop-2\] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.register Mapped "{\[/reload\],methods=\[PUT\]}" onto public org.springframework.http.ResponseEntity com.atlassian.synchrony.proxy.web.SynchronyProxyRestController.reloadConfiguration(com.atlassian.synchrony.proxy.web.SynchronyProxyConfigPayload)  
13-Mar-2019 21:54:35.511 INFO \[localhost-startStop-2\] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.initControllerAdviceCache Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date \[Wed Mar 13 21:54:33 AEDT 2019\]; root of context hierarchy  
13-Mar-2019 21:54:35.667 INFO \[localhost-startStop-2\] org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandler Mapped URL path \[/\*\*\] onto handler of type \[class org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler\]  
13-Mar-2019 21:54:35.917 INFO \[localhost-startStop-2\] org.springframework.context.support.DefaultLifecycleProcessor.start Starting beans in phase 2147483647  
13-Mar-2019 21:54:35.980 INFO \[localhost-startStop-2\] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization completed in 2203 ms  
13-Mar-2019 21:57:28.880 INFO \[localhost-startStop-3\] org.apache.catalina.startup.HostConfig.deployDescriptor Deploying deployment descriptor \[C:\\Program Files\\Atlassian\\Confluence\\conf\\Standalone\\localhost\\synchrony-proxy.xml\]  
13-Mar-2019 21:57:28.884 WARNING \[localhost-startStop-3\] org.apache.catalina.startup.HostConfig.deployDescriptor The path attribute with value \[/synchrony-proxy\] in deployment descriptor \[C:\\Program Files\\Atlassian\\Confluence\\conf\\Standalone\\localhost\\synchrony-proxy.xml\] has been ignored  
13-Mar-2019 21:57:28.888 WARNING \[localhost-startStop-3\] org.apache.catalina.startup.SetContextPropertiesRule.begin \[SetContextPropertiesRule\]{Context} Setting property 'debug' to '0' did not find a matching property.  
13-Mar-2019 21:57:30.263 INFO \[localhost-startStop-3\] org.apache.jasper.servlet.TldScanner.scanJars At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.  
13-Mar-2019 21:57:30.598 INFO \[localhost-startStop-3\] org.apache.catalina.core.ApplicationContext.log Spring WebApplicationInitializers detected on classpath: \[com.atlassian.synchrony.proxy.SynchronyDispatcherServletInitializer@333205bb\]  
13-Mar-2019 21:57:31.013 INFO \[localhost-startStop-3\] org.apache.catalina.core.ApplicationContext.log Initializing Spring FrameworkServlet 'dispatcher'  
13-Mar-2019 21:57:31.014 INFO \[localhost-startStop-3\] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization started  
13-Mar-2019 21:57:31.024 INFO \[localhost-startStop-3\] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.prepareRefresh Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date \[Wed Mar 13 21:57:31 AEDT 2019\]; root of context hierarchy  
13-Mar-2019 21:57:31.154 INFO \[localhost-startStop-3\] org.springframework.web.context.support.AnnotationConfigWebApplicationContext.loadBeanDefinitions Registering annotated classes: \[class com.atlassian.synchrony.proxy.websocket.WebSocketConfig,class com.atlassian.synchrony.proxy.web.SynchronyWebMvcConfig\]  
13-Mar-2019 21:57:32.092 INFO \[localhost-startStop-3\] org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler.initialize Initializing ExecutorService 'defaultSockJsTaskScheduler'  
13-Mar-2019 21:57:32.205 INFO \[localhost-startStop-3\] org.springframework.web.socket.server.support.WebSocketHandlerMapping.registerHandler Mapped URL path \[/v1/bayeux-sync1\] onto handler of type \[class org.springframework.web.socket.server.support.WebSocketHttpRequestHandler\]  
13-Mar-2019 21:57:32.500 INFO \[localhost-startStop-3\] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.register Mapped "{\[/healthcheck\]}" onto public com.atlassian.synchrony.proxy.web.HealthCheckResult com.atlassian.synchrony.proxy.web.SynchronyProxyRestController.getSynchronyProxyInfo()  
13-Mar-2019 21:57:32.502 INFO \[localhost-startStop-3\] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping.register Mapped "{\[/reload\],methods=\[PUT\]}" onto public org.springframework.http.ResponseEntity com.atlassian.synchrony.proxy.web.SynchronyProxyRestController.reloadConfiguration(com.atlassian.synchrony.proxy.web.SynchronyProxyConfigPayload)  
13-Mar-2019 21:57:33.196 INFO \[localhost-startStop-3\] org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.initControllerAdviceCache Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcher-servlet': startup date \[Wed Mar 13 21:57:31 AEDT 2019\]; root of context hierarchy  
13-Mar-2019 21:57:33.364 INFO \[localhost-startStop-3\] org.springframework.web.servlet.handler.SimpleUrlHandlerMapping.registerHandler Mapped URL path \[/\*\*\] onto handler of type \[class org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler\]  
13-Mar-2019 21:57:33.605 INFO \[localhost-startStop-3\] org.springframework.context.support.DefaultLifecycleProcessor.start Starting beans in phase 2147483647  
13-Mar-2019 21:57:33.662 INFO \[localhost-startStop-3\] org.springframework.web.servlet.DispatcherServlet.initServletBean FrameworkServlet 'dispatcher': initialization completed in 2648 ms  
13-Mar-2019 21:57:33.671 INFO \[localhost-startStop-3\] org.apache.catalina.startup.HostConfig.deployDescriptor Deployment of deployment descriptor \[C:\\Program Files\\Atlassian\\Confluence\\conf\\Standalone\\localhost\\synchrony-proxy.xml\] has finished in \[4,785\] ms  
13-Mar-2019 21:57:33.680 INFO \[main\] org.apache.coyote.AbstractProtocol.start Starting ProtocolHandler \["http-nio-8092"\]  
13-Mar-2019 21:57:33.721 INFO \[main\] org.apache.catalina.startup.Catalina.start Server startup in 184694 ms  
13-Mar-2019 21:57:35.290 INFO \[http-nio-8092-exec-1\] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate Initiating Jersey application, version 'Jersey: 1.19.4 05/24/2017 03:20 PM'  
13-Mar-2019 21:57:42.504 INFO \[http-nio-8092-exec-4\] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate Initiating Jersey application, version 'Jersey: 1.19.4 05/24/2017 03:20 PM'  
13-Mar-2019 21:57:43.922 INFO \[http-nio-8092-exec-6\] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate Initiating Jersey application, version 'Jersey: 1.19.4 05/24/2017 03:20 PM'  
13-Mar-2019 21:58:12.812 INFO \[http-nio-8092-exec-6\] com.sun.jersey.server.impl.application.WebApplicationImpl._initiate Initiating Jersey application, version 'Jersey: 1.19.4 05/24/2017 03:20 PM'


author: Shannon S
body: Hello,

The messages here appear to only be INFO and WARN messages. We'll need to look specifically at anything that says ERROR here, following with the line "caused by:"

Can you open the logs, tail them, and then attempt to login, looking for anything that pops up after this that says ERROR?

Regards,

Shannon


author: Rilwan Ahmed
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046) ,

I see similar error during space delete action.

> 2019-06-07 04:35:07,498 WARN \[Long running task: Space removal long running task\] \[confluence.impl.hibernate.ConfluenceHibernateTransactionManager\] doCommit Commit failed. Rolling back. Error: Object of class \[java.lang.Object\] with identifier \[null\]: optimistic locking failed; nested exception is net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update \[0\]; actual row count: 0; expected: 1  
> -- space: 178028546 \| url: /spaces/doremovespace.action \| traceId: 01d5c84d6b2cc265 \| userName: XXXXXXX \| referer: https://confluenceServer/spaces/removespace.action?key=VID \| action: doremovespace  
> 2019-06-07 04:35:07,499 WARN \[Long running task: Space removal long running task\] \[confluence.impl.hibernate.ConfluenceHibernateTransactionManager\] doRollback Performing rollback. Transactions:  
> -\>\[com.atlassian.confluence.spaces.DefaultSpaceManager.removeSpace\]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #1920160183)  
> -- space: 178028546 \| url: /spaces/doremovespace.action \| traceId: 01d5c84d6b2cc265 \| userName: XXXXXXX \| referer: https://confluenceServer/spaces/removespace.action?key=VID \| action: doremovespace  
> 2019-06-07 04:35:07,502 ERROR \[Long running task: Space removal long running task\] \[confluence.util.longrunning.ConfluenceAbstractLongRunningTask\] run Long running task "Space removal long running task" failed to run.  
> -- space: 178028546 \| url: /spaces/doremovespace.action \| traceId: 01d5c84d6b2cc265 \| userName: XXXXXXX \| referer: https://confluenceServer/spaces/removespace.action?key=VID \| action: doremovespace  
> org.springframework.orm.hibernate.HibernateOptimisticLockingFailureException: Object of class \[java.lang.Object\] with identifier \[null\]: optimistic locking failed; nested exception is net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update \[0\]; actual row count: 0; expected: 1  
> at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:593)  
> at org.springframework.orm.hibernate.HibernateTransactionManager.convertHibernateAccessException(HibernateTransactionManager.java:607)  
> at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:518)  
> at com.atlassian.confluence.impl.hibernate.ConfluenceHibernateTransactionManager.doCommit(ConfluenceHibernateTransactionManager.java:69)  
> at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:761)  
> at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:730)  
> at sun.reflect.GeneratedMethodAccessor66.invoke(Unknown Source)  
> at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
> at java.lang.reflect.Method.invoke(Method.java:498)  
> at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:302)  
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)  
> at com.sun.proxy.$Proxy54.commit(Unknown Source)  
> at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:485)  
> at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:291)  
> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)  
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
> at com.atlassian.spring.interceptors.SpringProfilingInterceptor.invoke(SpringProfilingInterceptor.java:16)  
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
> at com.atlassian.confluence.util.profiling.ConfluenceMonitoringMethodInterceptor.invoke(ConfluenceMonitoringMethodInterceptor.java:34)  
> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
> at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:208)  
> at com.sun.proxy.$Proxy113.removeSpace(Unknown Source)  
> at com.atlassian.confluence.api.impl.service.longtasks.tasks.SpaceRemovalLongRunningTask.runInternal(SpaceRemovalLongRunningTask.java:36)  
> at com.atlassian.confluence.util.longrunning.ConfluenceAbstractLongRunningTask.run(ConfluenceAbstractLongRunningTask.java:26)  
> at com.atlassian.confluence.util.longrunning.ManagedTask.run(ManagedTask.java:52)  
> at com.atlassian.confluence.impl.util.concurrent.ConfluenceExecutors$ThreadLocalContextTaskWrapper.lambda$wrap$1(ConfluenceExecutors.java:90)  
> at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$doInRequestContext$0(VCacheRequestContextOperations.java:50)  
> at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContextInternal(VCacheRequestContextManager.java:87)  
> at com.atlassian.confluence.impl.vcache.VCacheRequestContextManager.doInRequestContext(VCacheRequestContextManager.java:71)  
> at com.atlassian.confluence.vcache.VCacheRequestContextOperations.doInRequestContext(VCacheRequestContextOperations.java:49)  
> at com.atlassian.confluence.vcache.VCacheRequestContextOperations.lambda$withRequestContext$2(VCacheRequestContextOperations.java:66)  
> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)  
> at java.util.concurrent.FutureTask.run(FutureTask.java:266)  
> at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)  
> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)  
> at java.lang.Thread.run(Thread.java:748)  
> Caused by: net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update \[0\]; actual row count: 0; expected: 1


author: sixenvi
body: Just to add on to this, we have the same Problem with multiple of our instances:

```
019-07-17 17:41:03,646 INFO [http-nio-8090-exec-82] [synchrony.service.http.SynchronyRequestExecutor] execute Initiating request PUThttp://127.0.0.1:8091/synchrony/v1/data/Synchrony-fcf39372-d972-3325-a2f6-4a06254fa1ec/confluence-96081201?state-at=@head&state-format=htmlHTTP/1.1 for 96081201
2019-07-17 17:41:03,640 INFO [http-nio-8090-exec-82] [plugins.synchrony.service.SynchronyExternalChangesManager] performExternalChange Started external change for ContentId{id=96081201}

at org.hibernate.internal.ExceptionConverterImpl.wrapStaleStateException(ExceptionConverterImpl.java:212)
caused by: net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:593)
caused by: org.springframework.orm.hibernate.HibernateOptimisticLockingFailureException: Object of class [java.lang.Object] with identifier[null]: optimistic locking failed; nested exception is net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
pageId : 95159453
--------------------------
Parameters
--------------------------
com.atlassian.confluence.util.profiling.ConfluenceProfilingStrategy.splits: []
com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFilter: true
os_securityfilter_already_filtered: true
javax.servlet.error.exception: org.springframework.orm.hibernate.HibernateOptimisticLockingFailureException: Object of class [java.lang.Object]with identifier [null]: optimistic locking failed; nested exception is net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
com.atlassian.core.filters.HeaderSanitisingFilter_already_filtered: true
com.atlassian.prettyurls.filter.PrettyUrlsSiteMeshFixupFilter: true
javax.servlet.error.request_uri: /pages/viewpage.action
javax.servlet.jsp.jspException: org.springframework.orm.hibernate.HibernateOptimisticLockingFailureException: Object of class [java.lang.Object]with identifier [null]: optimistic locking failed; nested exception is net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
loginfilter.already.filtered: true
B3-TraceId: 32e81367f11941
defer.js.opt.in: true
com.opensymphony.sitemesh.USINGSTREAM: false
com.refinedwiki.confluence.plugins.theme.original.filters.StartSiteFilter_already_filtered: true
javax.servlet.error.message:?
javax.servlet.error.servlet_name: action
confluence.themecontext: com.atlassian.confluence.themes.ThemeContext@26fd33ae
bigpipe.mode.viewpage: true
webwork.valueStack: com.opensymphony.xwork.util.OgnlValueStack@2686cdb7
bigpipe.macro.execution.flag: []
view.page.action.helper: com.atlassian.confluence.themes.PageHelper@3451f9ca
com.atlassian.seraph.auth.LoginReason: OK
com.atlassian.confluence.web.ConfluenceJohnsonFilter_already_filtered: true
Confluence-Request-Time: 1563378023709
com.atlassian.gzipfilter.GzipFilter_already_filtered: true
com.atlassian.labs.botkiller.BotKillerFilter: true
theme.resource.path: /download/resources/com.refinedwiki.confluence.plugins.theme.original%3Apage/
atlassian.core.seraph.original.url: /500page.jsp?pageId=95159453
com.refinedwiki.confluence.plugins.theme.original.filters.BlogSpaceFilter_already_filtered: true
com.atlassian.confluence.web.filter.validateparam.RequestParamValidationFilter_already_filtered: true
com.refinedwiki.confluence.plugins.mobile.filters.MobileRedirectFilter_already_filtered: true
com.atlassian.confluence.util.message.MessagesDecoratorFilter_already_filtered_: true
__cleanup_recursion_counter: 0
com.opensymphony.sitemesh.APPLIED_ONCE: true
com.atlassian.confluence.impl.profiling.DecoratorTimings: com.atlassian.confluence.impl.profiling.DecoratorTimings@6a6d4e80
javax.servlet.error.status_code: 500
javax.servlet.forward.mapping: org.apache.catalina.core.ApplicationMapping$MappingImpl@af15158
javax.servlet.forward.query_string: pageId=95159453
javax.servlet.forward.servlet_path: /pages/viewpage.action
javax.servlet.forward.context_path:?
javax.servlet.forward.request_uri: /pages/viewpage.action
--------------------------
Attributes
--------------------------
Query String: pageId=95159453
Path Info: null
Servlet Path: /500page.jsp
Context Path:?
URI: /500page.jsp
Port: 443
Server: intern.universum.com
Scheme: https
URL: https://intern.xxx.com/500page.jsp
--------------------------
Request Information
--------------------------
usedPermGen = -1
freeMemory = 1540736256
usedHeap = 1197095680
maxHeap = 3227516928
maxPermGen = -1
availablePermGen = 0
totalMemoryInMegabytes = 2611
totalMemory = 2737831936
freeAllocatedHeap = 1540736256
allocatedHeap = 2737831936
freeMemoryInMegabytes = 1469
availableHeap = 2030421248
usedMemoryInMegabytes = 1141
usedMemory = 1197095680



--------------------------
JVM Stats
--------------------------
Request Unique ID : 9c052f15-dffe-47c5-a3ff-c58ef777ae5f
2019-07-17 17:40:23,834 INFO [http-nio-8090-exec-77] [atlassian.confluence.status.SystemErrorInformationLogger] writeToLog 
... 355 more
at org.springframework.orm.hibernate.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:510)
at com.atlassian.hibernate.adapter.adapters.TransactionV2Adapter.commit(TransactionV2Adapter.java:30)
at org.hibernate.engine.transaction.internal.TransactionImpl.commit(TransactionImpl.java:68)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl$TransactionDriverControlImpl.commit(JdbcResourceLocalTransactionCoordinatorImpl.java:220)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.access$100(JdbcResourceLocalTransactionCoordinatorImpl.java:38)
at org.hibernate.resource.transaction.backend.jdbc.internal.JdbcResourceLocalTransactionCoordinatorImpl.beforeCompletionCallback(JdbcResourceLocalTransactionCoordinatorImpl.java:146)
at org.hibernate.engine.jdbc.internal.JdbcCoordinatorImpl.beforeTransactionCompletion(JdbcCoordinatorImpl.java:467)
at org.hibernate.internal.SessionImpl.beforeTransactionCompletion(SessionImpl.java:2404)
at org.hibernate.internal.SessionImpl.flushBeforeTransactionCompletion(SessionImpl.java:3190)
at org.hibernate.internal.SessionImpl.managedFlush(SessionImpl.java:484)
at org.hibernate.internal.SessionImpl.doFlush(SessionImpl.java:1434)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:162)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:155)
at org.hibernate.internal.ExceptionConverterImpl.convert(ExceptionConverterImpl.java:86)
at org.hibernate.internal.ExceptionConverterImpl.wrapStaleStateException(ExceptionConverterImpl.java:212)
Caused by: net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from update [0]; actual row count: 0; expected: 1
...
```


author: Richard R
body: Getting this same error when trying to save an edited Gliffy diagram (can create the diagram and save it back to the Confluence page, but when I subsequently edit it and click Save I get the unexpected row count error.)

I can replicate the issue, and Confluence version is 7.4.17


author: MM _PREM_
body: Is there a general issue with that?

We experience the same issue after the latest sec-update.


author: Christopher Jaksch
body: Hi [@Richard R](/t5/user/viewprofilepage/user-id/4980565)

1) have you been able to resolve this problem?

2) did you try disabling Collaborative Editing and re-edit the Gliffy diagram?

If not, can you try running **workaround 3** as described here <https://confluence.atlassian.com/confkb/editing-shared-draft-shows-an-old-version-of-the-page-954248869.html> and give feedback if the editing is working again on your Gliffy diagram?

Thanks in advance  
Chris


author: Richard R
body: Hi Chris,

Thanks. No, I haven't been able to resolve the problem, and unfortunately I don't have the necessary Confluence admin rights to be able to try 2) or workaround 3. The workaround I'm using is to edit the graphics in Visio, and then re-import them into Gliffy each time.

Thanks,

Richard