<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
JBPM4_EXECUTION and JBPM4_HISTACTINST table's primary key(DBID_) is getting duplicated
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/FelixKJose">Felix Jose</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/570296#570296">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I am facing a strange issue in my JBPM application.</p><p>Here is my code:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>// Starts the WorkFlow.<br/>        ProcessInstance processInstance = executionService<br/>                .startProcessInstanceByKey("ddrRequest");</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        // Finds the Process Id for the particular WorkFlow.<br/>        String processId = processInstance.getId();<br/>        // Creates the WorkFlowDto with caseNo and Process Id.<br/>        WorkFlowDto workFlowDto = this.createWorkFlowDto(ddrDto, processId);<br/>        // Saves the WorkFlowDto in the WORKFLOW table.<br/>        this.iWorkFlowDao.saveWorkFlow(workFlowDto);</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The processId and primary key of JBPM4_EXECUTION and HistoryActInstance table are getting duplicated and I am getting the ConstraintViolation Exception. In my JBPM4_EXECUTION table there is already a ID_(processId) ddrRequests.4700056 and its primary key DBID_ is 4700056. And when I am starting a new processinstance using</p><p>      executionService<br/>                 .startProcessInstanceByKey("ddrRequest"); the processId generated is again ddrRequests.4700056 and DBID_ is  also 4700056 and so primary key constraintViolation exception I am getting. Sometimes the same issue is happening with historyActInstance table also.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>What can be the issue. Please give a quick resolution for this issue as our entire team is not able to do anything as we are not able to start the processInstance. Please help me. Its a critical issue for us......Please.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Also I am attaching the stackTrace below:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p class="MsoNormal">2010-11-09 16:46:12,423 (SpeaddLogger.java:67) ERROR com.jpmc.speadd - could not insert: [org.jbpm.pvm.internal.model.ExecutionImpl]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [org.jbpm.pvm.internal.model.ExecutionImpl]</p><p class="MsoNormal">            org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:621)</p><p class="MsoNormal">                        org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:412)</p><p class="MsoNormal">                        org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:377)</p><p class="MsoNormal">                        org.springframework.orm.hibernate3.HibernateTemplate.flush(HibernateTemplate.java:809)</p><p class="MsoNormal">                        com.jpmc.speadd.application.daoimpl.WorkFlowDao.saveWorkFlow(WorkFlowDao.java:29)</p><p class="MsoNormal">                        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p class="MsoNormal">                        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p class="MsoNormal">                        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p class="MsoNormal">                        java.lang.reflect.Method.invoke(Method.java:597)</p><p class="MsoNormal">                        org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)</p><p class="MsoNormal">                        org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p><p class="MsoNormal">                        org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p><p class="MsoNormal">                        org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</p><p class="MsoNormal">                        $Proxy12.saveWorkFlow(Unknown Source)</p><p class="MsoNormal">                        com.jpmc.speadd.application.appserviceimpl.WorkFlow.startWorkFlow(WorkFlow.java:225)</p><p class="MsoNormal">                        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p class="MsoNormal">                        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p class="MsoNormal">                        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p class="MsoNormal">                        java.lang.reflect.Method.invoke(Method.java:597)</p><p class="MsoNormal">                        org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)</p><p class="MsoNormal">                        org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p><p class="MsoNormal">                        org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p><p class="MsoNormal">                        org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</p><p class="MsoNormal">                        $Proxy14.startWorkFlow(Unknown Source)</p><p class="MsoNormal">                        com.jpmc.speadd.application.bizserviceimpl.DdrEntry.CreateDDR(DdrEntry.java:177)</p><p class="MsoNormal">                        com.jpmc.speadd.application.bizserviceimpl.DdrEntry.CreateDDRFromUI(DdrEntry.java:144)</p><p class="MsoNormal">                        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p class="MsoNormal">                        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p class="MsoNormal">                        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p class="MsoNormal">                        java.lang.reflect.Method.invoke(Method.java:597)</p><p class="MsoNormal">                        org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)</p><p class="MsoNormal">                        org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p><p class="MsoNormal">                        org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p><p class="MsoNormal">                        org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</p><p class="MsoNormal">                        $Proxy48.CreateDDRFromUI(Unknown Source)</p><p class="MsoNormal">                        com.jpmc.speadd.web.ddrentry.controller.DdrEntryController.submitDDR(DdrEntryController.java:1156)</p><p class="MsoNormal">                        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)</p><p class="MsoNormal">                        sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)</p><p class="MsoNormal">                        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p class="MsoNormal">                        java.lang.reflect.Method.invoke(Method.java:597)</p><p class="MsoNormal">                        org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:473)</p><p class="MsoNormal">                        org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:410)</p><p class="MsoNormal">                        org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)</p><p class="MsoNormal">                        sun.reflect.GeneratedMethodAccessor174.invoke(Unknown Source)</p><p class="MsoNormal">                        sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)</p><p class="MsoNormal">                        java.lang.reflect.Method.invoke(Method.java:597)</p><p class="MsoNormal">                        org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:307)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)</p><p class="MsoNormal">                        org.springframework.aop.framework.adapter.ThrowsAdviceInterceptor.invoke(ThrowsAdviceInterceptor.java:126)</p><p class="MsoNormal">                        org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)</p><p class="MsoNormal">                        org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)</p><p class="MsoNormal">                        $Proxy8.handleRequest(Unknown Source)</p><p class="MsoNormal">                        org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)</p><p class="MsoNormal">                        org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)</p><p class="MsoNormal">                        org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)</p><p class="MsoNormal">                        org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)</p><p class="MsoNormal">                        org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)</p><p class="MsoNormal">                        javax.servlet.http.HttpServlet.service(HttpServlet.java:637)</p><p class="MsoNormal">                        javax.servlet.http.HttpServlet.service(HttpServlet.java:717)</p><p class="MsoNormal">                        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)</p><p class="MsoNormal">                        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p class="MsoNormal">                        com.jpmc.speadd.common.filter.SpeaddUserCheckFilter.doFilter(SpeaddUserCheckFilter.java:140)</p><p class="MsoNormal">                        org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)</p><p class="MsoNormal">                        org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)</p><p class="MsoNormal">                        org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:219)</p><p class="MsoNormal">                        org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)</p><p class="MsoNormal">                        org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)</p><p class="MsoNormal">                        org.apache.catalina.ha.session.JvmRouteBinderValve.invoke(JvmRouteBinderValve.java:210)</p><p class="MsoNormal">                        org.apache.catalina.ha.tcp.ReplicationValve.invoke(ReplicationValve.java:347)</p><p class="MsoNormal">                        org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)</p><p class="MsoNormal">                        org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)</p><p class="MsoNormal">                        org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)</p><p class="MsoNormal">                        org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)</p><p class="MsoNormal">                        org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:574)</p><p class="MsoNormal">                        org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1527)</p><p class="MsoNormal">                        java.lang.Thread.run(Thread.java:619)</p><p class="MsoNormal" style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thank you and regards,</p><p>Felix K Jose</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/570296#570296">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in jBPM at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>