Bug 1030424 - Allow to set default schema that will be used for detecting if the tables already exist
Allow to set default schema that will be used for detecting if the tables alr...
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: BAM (Show other bugs)
Unspecified Unspecified
medium Severity medium
: ER6
: 6.0.0
Assigned To: Roger Martínez
Petr Široký
Depends On:
  Show dependency treegraph
Reported: 2013-11-14 07:26 EST by Petr Široký
Modified: 2014-08-06 16:11 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-08-06 16:11:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Petr Široký 2013-11-14 07:26:41 EST
Description of problem:
We are experiencing deployment issues with dashbuilder and db2 in case there is already a different schema that contains the dashbuilder tables. The dashbuilder tries to detect if the tables already exist - and it succeeds even though they are in different db2 schema. Later when some data are inserted into the table, the insert fails, because the tables actually does not exist in the current schema, where the user has write access. 

After discussion with David Gutierrez, we decided that it should be possible to set the "default_schema" property in hibernate.cfg.xml and then use this schema when searching for already existing tables.

Version-Release number of selected component (if applicable):

Additional info:
This is db2 specific issue.
Comment 1 Roger Martínez 2013-11-18 07:14:46 EST
The implemented solution is the one about adding the default_schema property to hibernate.cfg.xml file.

Commits on master

Commits on 6.0.x
Comment 2 Roger Martínez 2013-11-18 13:58:57 EST
After discussing this solution with David Gutierrez, we have added another option to set the default schema.

When the webapp is assembled in a WAR file, the hibernate.cfg.xml is located inside it. So, in order to change the schema, the user should open the WAR, modify the file and re-assembly it. 

Then we have added a system property too to handle the default schema. By this way the user does not require to open the WAR and modify the file, just setting the property "org.jboss.dashboard.database.hibernate.HibernateInitializer.defaultSchema", the value is captured on app startup and set into hibernate configuration.

To get the details see https://github.com/droolsjbpm/dashboard-builder/blob/master/builder/src/main/jbossas7/README.md#deploy-the-dashboard-builder

Commits on master

Commits on 6.0.x
Comment 3 Petr Široký 2014-01-16 06:14:41 EST
Verified in 6.0.0-ER7. Both options can be used to specify the default schema.

Note You need to log in before you can comment on or make changes to this bug.