Bug 1030407 - SqlIntegrityConstraintViolationException when duplicating workspace on IBM DB2 9.7
Summary: SqlIntegrityConstraintViolationException when duplicating workspace on IBM DB...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss BPMS Platform 6
Classification: Retired
Component: BAM
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: ER6
: 6.0.0
Assignee: Roger Martínez
QA Contact: Jan Hrcek
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-14 11:31 UTC by Jan Hrcek
Modified: 2014-08-06 20:10 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-06 20:10:29 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Server log with UNEXPECTED ERROR (102.19 KB, text/x-log)
2013-11-14 11:31 UTC, Jan Hrcek
no flags Details

Description Jan Hrcek 2013-11-14 11:31:10 UTC
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

How reproducible:
Always

Steps to Reproduce:
1. Login with admin user and navigate to workspace Showcase
2. In administration bar click 'Duplicate workspace'

Actual results:
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 

Expected results:
Workspace duplicatin should work.

Additional info:
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.

Comment 1 Roger Martínez 2013-11-18 16:45:14 UTC
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
=================
https://github.com/droolsjbpm/dashboard-builder/commit/1d9a39edb01a55157f6b8e4a86c9b923ee8395ad

Commits on 6.0.x
=================
https://github.com/droolsjbpm/dashboard-builder/commit/1c9461a4ccd8f27fed60779621e7f3614e1acfc2

Comment 2 Jan Hrcek 2014-01-03 13:46:54 UTC
Ok, verified with BPMS 6.0.0 ER7


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