<!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;">
Database reconnect failed for JBoss/JBPM
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/waldsgbq">Georg Waldschmidt</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/635439#635439">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>We are using JBoss-5.1.0.GA, JBPM 4.4 and Oracle 11g. </p><p>When we try to test the database reconnect abilities (by disconnecting the network connection between JBoss and the Oracle server),</p><p>After reestablishing the network connection, JBPM doesn't reconnect properly. Starting a new business process instance ends in an exception:</p><p>2011-11-07 17:34:34,041 ERROR [pool-24-thread-2] (Log4jLog.java:42) failed to execute job: 10500</p><p>org.jbpm.api.JbpmException: invalid transaction state: STATUS_ROLLING_BACK</p><p> at org.jbpm.pvm.internal.tx.JtaTransactionInterceptor.execute(JtaTransactionInterceptor.java:59)</p><p> at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.executeWithoutRetry(JtaRetryInterceptor.java:56)</p><p> at org.jbpm.pvm.internal.tx.JtaRetryInterceptor.execute(JtaRetryInterceptor.java:48)</p><p> at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.executeInNewEnvironment(EnvironmentInterceptor.java:53)</p><p> at org.jbpm.pvm.internal.svc.EnvironmentInterceptor.execute(EnvironmentInterceptor.java:40)</p><p> at org.jbpm.pvm.internal.svc.SkipInterceptor.execute(SkipInterceptor.java:43)</p><p> at org.jbpm.pvm.internal.jobexecutor.JobParcel.run(JobParcel.java:48)</p><p> at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)</p><p> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)</p><p> at java.util.concurrent.FutureTask.run(FutureTask.java:138)</p><p> at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)</p><p> at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)</p><p> at java.lang.Thread.run(Thread.java:619)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Has anyone any idea on how to ensure that JBPM's job executor proceeds processing new jobs (and ideally</p><p>jobs that got interrupted) after a database connection interrupt?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>We would expect, that JBoss's managed connection pool takes care of connections affected by the interrupt.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here the listing of datasource (jbpm-oracle-ds.xml)</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><?xml version="1.0" encoding="UTF-8"?></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><!-- ===================================================================== --></p><p><!--                                                                       --></p><p><!--  JBoss Server Configuration                                           --></p><p><!--                                                                       --></p><p><!-- ===================================================================== --></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><span><!-- $Id: jbpm-oracle-ds.xml 4458 2009-04-06 14:36:41Z </span><a class="jive-link-email-small" href="mailto:heiko.braun@jboss.com" target="_blank">heiko.braun@jboss.com</a><span> $ --></span></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><!-- ===================================================================== --></p><p><!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  --></p><p><!-- ===================================================================== --></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><datasources></p><p>  <xa-datasource></p><p>    <jndi-name>JbpmDS</jndi-name></p><p>    <track-connection-by-tx></track-connection-by-tx></p><p>    <check-valid-connection-sql>select count(*) from dual</check-valid-connection-sql></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <!-- uncomment to enable interleaving <interleaving/> --></p><p>    <isSameRM-override-value>false</isSameRM-override-value></p><p>    <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class></p><p>    <xa-datasource-property name="URL">jdbc:oracle:thin:@127.0.0.1:1521:JBPMDB</xa-datasource-property></p><p>    <xa-datasource-property name="User">USER</xa-datasource-property></p><p>    <xa-datasource-property name="Password">PASSWORD</xa-datasource-property></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool --></p><p>    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name--></p><p>    <!-- Checks the Oracle error codes and messages for fatal errors --></p><p>    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa --></p><p>    <no-tx-separate-pools/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) --></p><p>    <metadata></p><p>        <type-mapping>Oracle9i</type-mapping></p><p>    </metadata></p><p>  </xa-datasource></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter" </p><p>         name="jboss.jca:service=OracleXAExceptionFormatter"></p><p>    <depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends></p><p>  </mbean></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p></datasources></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/635439#635439">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>