Red Hat Bugzilla – Bug 1030407
SqlIntegrityConstraintViolationException when duplicating workspace on IBM DB2 9.7
Last modified: 2014-08-06 16:10:29 EDT
Created attachment 823893 [details]
Server log with UNEXPECTED ERROR
Description of problem:
When you try to duplicate workspace there is an unexpected error and the workspace is not duplicated.
Version-Release number of selected component (if applicable):
BPMS 6.0.0 ER4
IBM DB2 9.7 configured as datasource
Steps to Reproduce:
1. Login with admin user and navigate to workspace Showcase
2. In administration bar click 'Duplicate workspace'
Unexpected error dialog appears. The exception is com.ibm.db2.jcc.am.SqlIntegrityConstraintViolationException: DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=2, TABLEID=14, COLNO=3, DRIVER=4.14.122
Workspace duplicatin should work.
There might be some error in the DDL file 1-create-db2.sql, as on all the other databases we are testing with the workspace duplication functionality works correctly.
See server log attached for full exception stack trace.
In DB2 the "unique" constraint for a table column seems to be handled different from other dbms. Unique constraint in DB2 implies the "not null" constraint too.
When duplicating a workspace in the dashbuilder webapp, the duplicated entity contains, as a initial value, null for the "url" field, which is mapped to a database column that had a "unique" constraint. Then a constraint violation exception was threw.
As the "unquie" constraint for "url" field is implemented by Java coding too, I just have removed the unique constraint for the DB2 case.
Commits on master
Commits on 6.0.x
Ok, verified with BPMS 6.0.0 ER7