Bug 1030424 - Allow to set default schema that will be used for detecting if the tables already exist
Summary: Allow to set default schema that will be used for detecting if the tables alr...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: BAM
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ER6
: 6.0.0
Assignee: Roger Martínez
QA Contact: Petr Široký
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-14 12:26 UTC by Petr Široký
Modified: 2014-08-06 20:11 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:11:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Petr Široký 2013-11-14 12:26:41 UTC
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 12:14:46 UTC
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 18:58:57 UTC
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 11:14:41 UTC
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.