Uploaded image for project: 'Bitbucket Data Center'
  1. Bitbucket Data Center
  2. BSERV-3540

Add schema support when connecting Stash to SQL Server, PostgreSQL and Oracle



    • Suggestion
    • Resolution: Unresolved
    • None
    • None
    • None
    • 19
    • We collect Bitbucket feedback from various sources, and we evaluate what we've collected when planning our product roadmap. To understand how this piece of feedback will be reviewed, see our Implementation of New Features Policy.


      Steps to reproduce:

      SQL Server

      1. Create a database 'atlassian'
      2. Create a schema name 'stash' in the database
      3. Create a user 'stash' with the default schema 'stash'
      4. Connect Stash server with SQL server database 'atlassian'

      All the tables are created in the default schema 'dbo' except for AO tables created in schema 'stash'


      1. Create a database user 'stash'
      2. Grant all the permission to the user 'stash' on the schema 'stash'
      3. Grant another access permission to the user 'stash' on the schema 'crowd' (schema 'crowd' has been used by Crowd application)
      4. Migrate Stash database from HSQLDB to Oracle through the UI
        It will fail with the following error:
        2014-02-07 12:09:03,235 ERROR [http-bio-7990-exec-7] 728x27x0 jv58e6 "POST /setup HTTP/1.1" c.a.s.i.db.DefaultDatabaseManager Failed to obtain session factory
        org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'sessionFactoryPrototype' defined in class path resource [stash-context.xml]: Invocation of init method failed; nested exception is org.hibernate.HibernateException: Missing column: is_allow_all in CROWD.CWD_APP_DIR_MAPPING
        	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1512) ~[spring-beans-3.2.5.RELEASE.jar:3.2.5.RELEASE]
        	at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1129) ~[spring-context-3.2.5.RELEASE.jar:3.2.5.RELEASE]
        	at com.atlassian.stash.internal.db.DefaultDatabaseManager.createSessionFactory(DefaultDatabaseManager.java:337) [stash-service-impl-2.10.1.jar:na]
        	at com.atlassian.stash.internal.db.DefaultDatabaseManager.prepareDatabase(DefaultDatabaseManager.java:158) [stash-service-impl-2.10.1.jar:na]

        it seems that Stash somehow try to use the schema 'crowd' cause the database user 'stash' have access permission to it.


        Issue Links



              Unassigned Unassigned
              klfoong Foong (Inactive)
              16 Vote for this issue
              25 Start watching this issue