cancel
Showing results for 
Search instead for 
Did you mean: 

Duplicate Row error on redeploy of BPMN file, Activiti 5.10

mindcrime
Champ in-the-making
Champ in-the-making
Fellow Aciviti'ers:

I'm seeing some strange behaviour when redeploying a BPMN file through Activiti Explorer.  This only seems
to happen if the BPMN in question has running processes associated with it.   In this case, when you
upload the new BPMN, the following error is encountered.   The DB2 SQLSTATE and SQLCODE numbers
below correspond to "duplicate row".  So it appears that we are somehow trying to insert a duplicate
record into  ACT_RE_DEPLOYMENT.

Any idea why this is happening, and if there is a workaround?



Mar 22, 2013 10:17:38 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource Enrollment_With_Tech_Exception_Path.bpmn20.xml
Mar 22, 2013 10:17:39 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Mar 22, 2013 10:17:39 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Mar 22, 2013 10:17:39 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='enrollment_With__Tech_Exceptions' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
Mar 22, 2013 10:17:46 AM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
### The error may involve org.activiti.engine.impl.persistence.entity.DeploymentEntity.insertDeployment-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RE_DEPLOYMENT(ID_, NAME_, DEPLOY_TIME_)     values(?, ?, ?)
### Cause: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134)
   at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:459)
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:369)
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:157)
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:109)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:54)
   at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:106)
   at org.activiti.explorer.ui.management.deployment.DeploymentUploadReceiver.deployUploadedFile(DeploymentUploadReceiver.java:83)
   at org.activiti.explorer.ui.management.deployment.DeploymentUploadReceiver.uploadFinished(DeploymentUploadReceiver.java:71)
   at org.activiti.explorer.ui.custom.UploadComponent.uploadFinished(UploadComponent.java:173)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)
   at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
   at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
   at com.vaadin.ui.Upload.fireUploadSuccess(Upload.java:744)
   at com.vaadin.ui.Upload$1.streamingFinished(Upload.java:1022)
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.streamToReceiver(AbstractCommunicationManager.java:593)
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleSimpleMultipartFileUpload(AbstractCommunicationManager.java:469)
   at com.vaadin.terminal.gwt.server.CommunicationManager.handleFileUpload(CommunicationManager.java:257)
   at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:495)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:679)
Caused by: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
   at com.ibm.db2.jcc.a.wc.a(wc.java:588)
   at com.ibm.db2.jcc.a.wc.a(wc.java:60)
   at com.ibm.db2.jcc.a.wc.a(wc.java:127)
   at com.ibm.db2.jcc.a.fl.b(fl.java:1599)
   at com.ibm.db2.jcc.a.fl.c(fl.java:1582)
   at com.ibm.db2.jcc.t4.db.k(db.java:353)
   at com.ibm.db2.jcc.t4.db.a(db.java:59)
   at com.ibm.db2.jcc.t4.t.a(t.java:50)
   at com.ibm.db2.jcc.t4.tb.b(tb.java:200)
   at com.ibm.db2.jcc.a.gl.Kb(gl.java:2365)
   at com.ibm.db2.jcc.a.gl.e(gl.java:3143)
   at com.ibm.db2.jcc.a.gl.Fb(gl.java:1848)
   at com.ibm.db2.jcc.a.gl.execute(gl.java:1832)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
   at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41)
   at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66)
   at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45)
   at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108)
   at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145)
   … 41 more
Mar 22, 2013 10:17:46 AM org.activiti.engine.impl.bpmn.deployer.BpmnDeployer deploy
INFO: Processing resource Enrollment_With_Tech_Exception_Path.bpmn20.xml
Mar 22, 2013 10:17:47 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XMLSchema currently not supported as typeLanguage
Mar 22, 2013 10:17:47 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseDefinitionsAttributes
INFO: XPath currently not supported as expressionLanguage
Mar 22, 2013 10:17:47 AM org.activiti.engine.impl.bpmn.parser.BpmnParse parseProcessDefinitions
INFO: Process with id='enrollment_With__Tech_Exceptions' hasn't the attribute isExecutable set. Please maintain it, so you are compatible to future activiti versions.
Mar 22, 2013 10:17:48 AM org.activiti.engine.impl.interceptor.CommandContext close
SEVERE: Error while closing command context
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
### The error may involve org.activiti.engine.impl.persistence.entity.DeploymentEntity.insertDeployment-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RE_DEPLOYMENT(ID_, NAME_, DEPLOY_TIME_)     values(?, ?, ?)
### Cause: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134)
   at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:459)
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:369)
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:157)
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:109)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:54)
   at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:106)
   at org.activiti.explorer.ui.management.deployment.DeploymentUploadReceiver.deployUploadedFile(DeploymentUploadReceiver.java:83)
   at org.activiti.explorer.ui.management.deployment.DeploymentUploadReceiver.uploadFinished(DeploymentUploadReceiver.java:71)
   at org.activiti.explorer.ui.custom.UploadComponent.uploadFinished(UploadComponent.java:173)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)
   at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
   at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
   at com.vaadin.ui.Upload.fireUploadInterrupted(Upload.java:731)
   at com.vaadin.ui.Upload$1.streamingFailed(Upload.java:1037)
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.streamToReceiver(AbstractCommunicationManager.java:612)
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleSimpleMultipartFileUpload(AbstractCommunicationManager.java:469)
   at com.vaadin.terminal.gwt.server.CommunicationManager.handleFileUpload(CommunicationManager.java:257)
   at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:495)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:679)
Caused by: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
   at com.ibm.db2.jcc.a.wc.a(wc.java:588)
   at com.ibm.db2.jcc.a.wc.a(wc.java:60)
   at com.ibm.db2.jcc.a.wc.a(wc.java:127)
   at com.ibm.db2.jcc.a.fl.b(fl.java:1599)
   at com.ibm.db2.jcc.a.fl.c(fl.java:1582)
   at com.ibm.db2.jcc.t4.db.k(db.java:353)
   at com.ibm.db2.jcc.t4.db.a(db.java:59)
   at com.ibm.db2.jcc.t4.t.a(t.java:50)
   at com.ibm.db2.jcc.t4.tb.b(tb.java:200)
   at com.ibm.db2.jcc.a.gl.Kb(gl.java:2365)
   at com.ibm.db2.jcc.a.gl.e(gl.java:3143)
   at com.ibm.db2.jcc.a.gl.Fb(gl.java:1848)
   at com.ibm.db2.jcc.a.gl.execute(gl.java:1832)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
   at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41)
   at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66)
   at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45)
   at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108)
   at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145)
   … 41 more
Mar 22, 2013 10:17:48 AM com.vaadin.Application terminalError
SEVERE: Terminal error:
com.vaadin.event.ListenerMethod$MethodException
Cause: org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
### The error may involve org.activiti.engine.impl.persistence.entity.DeploymentEntity.insertDeployment-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RE_DEPLOYMENT(ID_, NAME_, DEPLOY_TIME_)     values(?, ?, ?)
### Cause: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
   at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:510)
   at com.vaadin.event.EventRouter.fireEvent(EventRouter.java:164)
   at com.vaadin.ui.AbstractComponent.fireEvent(AbstractComponent.java:1193)
   at com.vaadin.ui.Upload.fireUploadInterrupted(Upload.java:731)
   at com.vaadin.ui.Upload$1.streamingFailed(Upload.java:1037)
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.streamToReceiver(AbstractCommunicationManager.java:612)
   at com.vaadin.terminal.gwt.server.AbstractCommunicationManager.doHandleSimpleMultipartFileUpload(AbstractCommunicationManager.java:469)
   at com.vaadin.terminal.gwt.server.CommunicationManager.handleFileUpload(CommunicationManager.java:257)
   at com.vaadin.terminal.gwt.server.AbstractApplicationServlet.service(AbstractApplicationServlet.java:495)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)
   at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
   at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
   at java.lang.Thread.run(Thread.java:679)
Caused by: org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
### The error may involve org.activiti.engine.impl.persistence.entity.DeploymentEntity.insertDeployment-Inline
### The error occurred while setting parameters
### SQL: insert into ACT_RE_DEPLOYMENT(ID_, NAME_, DEPLOY_TIME_)     values(?, ?, ?)
### Cause: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
   at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:23)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:147)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:134)
   at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:459)
   at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:369)
   at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:157)
   at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:109)
   at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:49)
   at org.activiti.spring.SpringTransactionInterceptor$1.doInTransaction(SpringTransactionInterceptor.java:42)
   at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:130)
   at org.activiti.spring.SpringTransactionInterceptor.execute(SpringTransactionInterceptor.java:40)
   at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:33)
   at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:54)
   at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:106)
   at org.activiti.explorer.ui.management.deployment.DeploymentUploadReceiver.deployUploadedFile(DeploymentUploadReceiver.java:83)
   at org.activiti.explorer.ui.management.deployment.DeploymentUploadReceiver.uploadFinished(DeploymentUploadReceiver.java:71)
   at org.activiti.explorer.ui.custom.UploadComponent.uploadFinished(UploadComponent.java:173)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
   at java.lang.reflect.Method.invoke(Method.java:616)
   at com.vaadin.event.ListenerMethod.receiveEvent(ListenerMethod.java:490)
   … 21 more
Caused by: com.ibm.db2.jcc.a.ym: DB2 SQL Error: SQLCODE=-803, SQLSTATE=23505, SQLERRMC=1;ACTDB01.ACT_RE_DEPLOYMENT, DRIVER=3.51.90
   at com.ibm.db2.jcc.a.wc.a(wc.java:588)
   at com.ibm.db2.jcc.a.wc.a(wc.java:60)
   at com.ibm.db2.jcc.a.wc.a(wc.java:127)
   at com.ibm.db2.jcc.a.fl.b(fl.java:1599)
   at com.ibm.db2.jcc.a.fl.c(fl.java:1582)
   at com.ibm.db2.jcc.t4.db.k(db.java:353)
   at com.ibm.db2.jcc.t4.db.a(db.java:59)
   at com.ibm.db2.jcc.t4.t.a(t.java:50)
   at com.ibm.db2.jcc.t4.tb.b(tb.java:200)
   at com.ibm.db2.jcc.a.gl.Kb(gl.java:2365)
   at com.ibm.db2.jcc.a.gl.e(gl.java:3143)
   at com.ibm.db2.jcc.a.gl.Fb(gl.java:1848)
   at com.ibm.db2.jcc.a.gl.execute(gl.java:1832)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
   at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
   at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:41)
   at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:66)
   at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:45)
   at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:108)
   at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)
   at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:145)
   … 41 more
7 REPLIES 7

frederikherema1
Star Contributor
Star Contributor
Is it a single process BPMN-fiel you deploy or is it a BAR-file? Do you see the same behavior on the default H2-db (if it's possible to test this in your environment with your processes).

mindcrime
Champ in-the-making
Champ in-the-making
Is it a single process BPMN-fiel you deploy or is it a BAR-file? Do you see the same behavior on the default H2-db (if it's possible to test this in your environment with your processes).

It's a single .bpmn20.xml file.   I might be able to setup an H2 based environment to test this, but it'll take a little bit of work, as our current dev environment is all DB2 based. 

I have tried a similar experiment with a local install of Activiti Explorer, backed by PostgreSQL, and can confirm that - in at least some circumstances - redeploying a BPMN, even if it has associated running instances - works OK.  But the BPMN I was experimenting with in that environment wasn't the same one I was using in dev.  So right now, I don't know if it's more likely that the problem is something to do with the difference between PostgreSQL / DB2, or if it involves a difference in the actual process definition itself. 

I'll keep doing some more experiments here and see if I can narrow things down a bit…

mindcrime
Champ in-the-making
Champ in-the-making
OK, I experimented with this some more.  Here's the deal:  Using a specific BPMN, I can deploy, start, redeploy - with no errors - using an Activiti Explorer instance backed by PostreSQL.   However, using an instance backed by DB/2, using the exact same BPMN file, redeploy results in the "duplicate row" error listed above.  So this does appear to be something specific to the DB/2 support.

My first hunch is that the db scripts may not be creating the unique constraint correctly on DB/2.  I'll start examining that, but if anyone else has any ideas or suggestions, I'm all ears.  I really need to get this working for a client, and DB/2 is - for better or worse - non-negotiable here. 

Thanks!

jbarrez
Star Contributor
Star Contributor
Hmm sounds really strange. Would you be able to inspect the contents of the db before the exception happens?

Could you also set the log level to debug, that way you can see what data is going into the database.

mindcrime
Champ in-the-making
Champ in-the-making
Hmm sounds really strange. Would you be able to inspect the contents of the db before the exception happens?

Could you also set the log level to debug, that way you can see what data is going into the database.

I attached a remote debugger and stepped through the deploy process yesterday, although I didn't quite find exactly where the error is occurring.  I'm not very familiar with that part of the Activiti code, nor with iBatis, unfortunately.  However, my suspicion now is that the problem has something to do with the primary key generation for new persistent objects.  I'm going to switch Activiti Explorer over to using UUIDs and test that, as a quick "spike" to see if it solves the problem.  If it does, we're actually fine, since we were planning to go with UUIDs anyway.  If that doesn't work, I'll try setting the logs to debug, and/or doing some additional exploration with the debugger.


One quick side note, which may or may not be relevant… looking at my console log from yesterday, it looks like one attempt to redeploy this BPMN resulted in that same error message / stacktrace being printed four times.  Not sure if maybe there's some retry logic in there, or if the error is just being logged multiple times or what.

mindcrime
Champ in-the-making
Champ in-the-making
OK, I think I have this figured out.  In our DEV db, there is a unique constraint on the 'NAME' column of the ACT_RE_DEPLOYMENT table.  This constraint is not present in, for example, my local PostgreSQL instance.

Strangely enough, the constraint name is 'ACT_UNIQ_RE_DEPLOY_NAME' but I grepped through the Activiti 5.10 source and could not find that symbol anywhere.  Does anyone know if maybe that's a throwback to a previous version of Activiti or something?  The client claim they didn't make any changes to the Activiti db, so I'm assuming it go put there by the Activiti install script, at some point.

frederikherema1
Star Contributor
Star Contributor
It seems like that is a remainder from the initial "experimental" DB2-support. This constraint can be safely dropped, as it makes no sense to be on the table. Anyhow, 5.10+ doesn't contain this constraint anymore, maybe that's why not many people run into this issue. Thanks for sharing!