Opps an error has occured
Asked by Tim Oldendorf:

I placed a ticket to Atlassian for this sometime last week, but never heard anything back from it.

I have users that are randomly getting this message when trying to go to different pages. It is not the same user and there are no patterns to the pages that it happens to. They will tell me the error occured, and then I will try and go to the same page and it will work with no problem.

Sometimes if I have the user back up and try again, they will get into the page without a problem. Other times they have to try 5-10 times before they are able to load the page.

Can anybody help guide me of what I should look at to try and resolve this issue?

Confluence Server 6.4.3

![2019-02-19_11h18_23.png](/t5/image/serverpage/image-id/46213iAB655E605B3DC1AC/image-dimensions/466x442?v=v2 "2019-02-19_11h18_23.png")


Answers:
author: Johannes Heinzl
body: Hello,

the solution is to TURN OFF "SET NOCOUNT" similarily to the Jira MSSQL instructions, because hibernate expects a row number count.

<https://confluence.atlassian.com/adminjiraserver085/connecting-jira-applications-to-sql-server-2017-981154594.html>

I could reproduce this error and tested working behaviour with Confluence 7.4.1 and MSSQL 2017.

> Turn off the SET NOCOUNT option.
>
> 1. Open SQL Server Management Studio.
> 2. Go to **Tools \> Options \> Query Execution \> SQL Server \> Advanced** , and clear the **SET NOCOUNT** check box.  
>    ![](https://confluence.atlassian.com/adminjiraserver085/files/981154594/981154596/1/1575971295654/standalone-dbconfig-sqlserver2005_config.png)  
>
> 3. Right-click your server in the Object Explorer, and go to **Properties \> Connections \> Default Connections** . Clear the **no count** option.  
>
>    ![](https://confluence.atlassian.com/adminjiraserver085/files/981154594/981154595/1/1575971295524/standalone-dbconfig-sql2008_server_properties.png)

Best regards,

Johannes


author: Sven-Peter Barth
body: i have the same Problem with MSSQL 2017 an Confluence 7.21


author: Tim Oldendorf
body: We use SQL Server. Here is alittle more of the error log that I get when a user gets the error message. Not sure if this is any more help?

```
Cause
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)
caused by: net.sf.hibernate.StaleObjectStateException: Batch update returned unexpected row count from 
update [0]; actual row count: 0; expected: 1
at org.hibernate.internal.ExceptionConverterImpl.wrapStaleStateException 
(ExceptionConverterImpl.java:212)
Stack Trace:[hide]
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.GeneratedMethodAccessor61.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.$Proxy34.commit(Unknown Source)
at com.atlassian.xwork.interceptors.TransactionalInvocation.commitOrRollbackTransaction 
(TransactionalInvocation.java:107)
at com.atlassian.xwork.interceptors.TransactionalInvocation.invokeInTransaction 
(TransactionalInvocation.java:67)
at com.atlassian.xwork.interceptors.XWorkTransactionInterceptor.intercept 
(XWorkTransactionInterceptor.java:56)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.atlassian.confluence.xwork.SetupIncompleteInterceptor.intercept 
(SetupIncompleteInterceptor.java:43)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.atlassian.confluence.security.interceptors.SecurityHeadersInterceptor.intercept 
(SecurityHeadersInterceptor.java:39)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:35)
at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:165)
at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:115)
at com.atlassian.confluence.servlet.ConfluenceServletDispatcher.serviceAction 
(ConfluenceServletDispatcher.java:56)
at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:199)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:292)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.atlassian.confluence.web.filter.DebugFilter.doFilter(DebugFilter.java:46)
at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter 
(ApplicationFilterChain.java:240)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:207)
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter 
(IteratingFilterChain.java:39)
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter 
(DelegatingPluginFilter.java:58)
at com.atlassian.confluence.extra.jira.filters.SingleJiraIssuesMapThreadLocalFilter.doFilter 
(SingleJiraIssuesMapThreadLocalFilter.java:40)
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter 
(DelegatingPluginFilter.java:64)
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter 
(IteratingFilterChain.java:37)
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter 
(DelegatingPluginFilter.java:58)
at com.atlassian.confluence.plugins.baseurl.IncludeResourcesFilter.doFilter 
(IncludeResourcesFilter.java:42)
at com.atlassian.core.filters.AbstractHttpFilter.doFilter(AbstractHttpFilter.java:31)
at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter 
(DelegatingPluginFilter.java:64)
at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter
```


author: JP _AC Bielefeld Leader_
body: Are you using MySQL? Sure that you set up the transaction setting correctly?

    transaction-isolation=READ-COMMITTED


author: Moses Thomas
body: [@Tim Oldendorf](/t5/user/viewprofilepage/user-id/1156469) Please could you provide the log in \<confluence_home_directory\>/logs. this one in the picture is not complete.


Tags: confluence-server

server