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...
Status: CLOSED CURRENTRELEASE
Product: JBoss BPMS Platform 6
Classification: JBoss
Component: BAM (Show other bugs)
6.0.0
Unspecified Unspecified
medium Severity medium
: ER6
: 6.0.0
Assigned To: Roger Martínez
Petr Široký
:
Depends On:
Blocks:
  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:
Environment:
Last Closed: 2014-08-06 16:11:17 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
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):
6.0.0-ER4


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
=================
https://github.com/droolsjbpm/dashboard-builder/commit/7b5c024531e3b338035b7468d74f64529a504000

Commits on 6.0.x
=================
https://github.com/droolsjbpm/dashboard-builder/commit/9fcfe369a7bc5147d0b5fcea1247134a4ea631ad
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
=================
https://github.com/droolsjbpm/dashboard-builder/commit/54b0e0e3cb2e539a326a77362e6fd6b23a57c283

Commits on 6.0.x
=================
https://github.com/droolsjbpm/dashboard-builder/commit/5c9130d334bfd05f8bb185ca86abe1130a8203bd
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.