Problem with Confluence Upgrade from 3.4.3 to 3.5.9 on SQL Server 2008
Asked by David Scull:

I am trying to upgrade confluence on our testing server and seeing a whole heap of errors in the logs when confluence tries to upgrade the database

2011-08-01 13:45:27,730 ERROR \[Thread-2\] \[atlassian.confluence.upgrade.UpgradeLauncherServletContextListener\] contextInitialized Upgrade failed, application will not start: Schema upgrade task \[ [com.atlassian.confluence.upgrade.upgradetask.AddBandanaConstraintsUpgradeTask@5b2cfeb7](mailto:com.atlassian.confluence.upgrade.upgradetask.AddBandanaConstraintsUpgradeTask@5b2cfeb7) \] failed due to : StatementCallback; uncategorized SQLException for SQL \[drop index band_context_idx on BANDANA\]; SQL state \[S1000\]; error code \[3964\]; Transaction failed because this DDL statement is not allowed inside a snapshot isolation transaction. Since metadata is not versioned, a metadata change can lead to inconsistency if mixed within snapshot isolation.; nested exception is java.sql.SQLException: Transaction failed because this DDL statement is not allowed inside a snapshot isolation transaction. Since metadata is not versioned, a metadata change can lead to inconsistency if mixed within snapshot isolation.  
com.atlassian.confluence.upgrade.UpgradeException: Schema upgrade task \[ [com.atlassian.confluence.upgrade.upgradetask.AddBandanaConstraintsUpgradeTask@5b2cfeb7](mailto:com.atlassian.confluence.upgrade.upgradetask.AddBandanaConstraintsUpgradeTask@5b2cfeb7) \] failed due to : StatementCallback; uncategorized SQLException for SQL \[drop index band_context_idx on BANDANA\]; SQL state \[S1000\]; error code \[3964\]; Transaction failed because this DDL statement is not allowed inside a snapshot isolation transaction. Since metadata is not versioned, a metadata change can lead to inconsistency if mixed within snapshot isolation.; nested exception is java.sql.SQLException: Transaction failed because this DDL statement is not allowed inside a snapshot isolation transaction. Since metadata is not versioned, a metadata change can lead to inconsistency if mixed within snapshot isolation.  
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.runSchemaUpgradeTasks(AbstractUpgradeManager.java:301)  
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgradeSchema(AbstractUpgradeManager.java:235)  
at com.atlassian.confluence.upgrade.AbstractUpgradeManager.upgrade(AbstractUpgradeManager.java:87)  
at com.atlassian.confluence.upgrade.impl.DefaultUpgradeManager.upgrade(DefaultUpgradeManager.java:139)  
at com.atlassian.confluence.upgrade.UpgradeLauncherServletContextListener.contextInitialized(UpgradeLauncherServletContextListener.java:28)  
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3972)  
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4467)  
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)  
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)  
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)  
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)  
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)  
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)  
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)  
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)  
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)  
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)  
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)  
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)  
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)  
at org.apache.catalina.core.StandardService.start(StandardService.java:519)  
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)  
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)  
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)  
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)  
at java.lang.reflect.Method.invoke(Unknown Source)  
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)  
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)  

I have checked the DB settings and run this on the DB to make sure i have the transaction level correctly set

ALTER DATABASE confluence  
SET READ_COMMITTED_SNAPSHOT ON   
WITH ROLLBACK IMMEDIATE;

Does anyone know what i am doing wrong?


Answers:
author: Jeremy Largman
body: Hi David,

It looks like you opened a support ticket with us and we were able to figure it out. Please accept this solution if that's right. From what I can tell, it's this:

1. From confluence.cfg.xml, remove \<property name="hibernate.connection.isolation"\>4096\</property\>
2. On the database, run:

```
ALTER DATABASE confluence
```

```
SET ALLOW_SNAPSHOT_ISOLATION OFF
```

We'll write a KB article for this.


Tags: sql

upgrade