<!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">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;">
JBPM 4.3 - org.jbpm.api.JbpmException: couldn't acquire block of ids
</h3>
<span style="margin-bottom: 10px;">
reply from <a href="http://community.jboss.org/people/campa">Stefano Campanini</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/539201#539201">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 <a class="jive-link-profile-small" href="http://community.jboss.org/people/swiderski.maciej">Maciej</a></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I'm integratig JBPM into webapp based on Spring 3.0 all thing are managed using spring. Here sono details:</p><p>Datasource is DBCP via JNDI</p><p>TransactionManager is managed by spring</p><p>Persistace is Spring and Ibatis based</p><p>HBMSession, used only for jbpm, is configured as this</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><bean id="sessionFactory" ><br/>        <property name="dataSource" ref="appDataSource" /><br/>        <property name="useTransactionAwareDataSource" value="true" /> <!--  it use transaciton spring managed --><br/>        <property name="hibernateProperties"><br/>          <value><br/>            hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect<br/>            hibernate.hbm2ddl.auto=update<br/>            hibernate.format_sql=true<br/>            hibernate.show_sql=true<br/>          </value><br/>        </property><br/>        <property name="mappingLocations"><br/>            <list><br/>                <value>classpath:jbpm.execution.hbm.xml</value><br/>                <value>classpath:jbpm.repository.hbm.xml</value><br/>                <value>classpath:jbpm.task.hbm.xml</value><br/>                <value>classpath:jbpm.history.hbm.xml</value><br/>                <value>classpath:jbpm.identity.hbm.xml</value><br/>            </list><br/>        </property><br/>    </bean></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>JBPM Spring iontegration is done using jbpm community way:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><bean id="springJbpmHelper" name="springHelper" ><br/>       <property name="jbpmCfg" value="conf/jbpm.cfg.xml" /><br/></bean>    <br/><bean id="processEngine" factory-bean="springJbpmHelper" factory-method="createProcessEngine" /></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>My JBPMConfiguration is here:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><jbpm-configuration></p><p>    <!--  <import resource="jbpm.default.cfg.xml" />--></p><p>    <!--</p><p>        jbpm.default.cfg.xml , modified <repository-cache /> with <object</p><p>        class="org.jbpm.pvm.internal.repository.RepositoryCacheImpl" /></p><p>    --></p><p>    <import resource="jbpm.default.scriptmanager.xml" /></p><p>    <process-engine-context></p><p>        <repository-service /></p><p>        <!--    <repository-cache /> --></p><p>        <object /></p><p>        <execution-service /></p><p>        <history-service /></p><p>        <management-service /></p><p>        <identity-service /></p><p>        <task-service /></p><p>        <object></p><p>            <field name="commandService"></p><p>                <ref object="txRequiredCommandService" /></p><p>            </field></p><p>        </object></p><p>        <object  init="eager" /></p><p>        <types resource="jbpm.variable.types.xml" /></p><p>        <address-resolver /></p><p>        <mail-template name='task-notification'></p><p>            <to users="${task.assignee}" /></p><p>            <subject>${task.name}</subject></p><p>            <text><![CDATA[Hi ${task.assignee}, Task "${task.name}" has been assigned to you. ${task.description}</p><p>                        Sent by JBoss jBPM ]]></text></p><p>        </mail-template></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>        <mail-template name='task-reminder'></p><p>            <to users="${task.assignee}" /></p><p>            <subject>${task.name}</subject></p><p>            <text><![CDATA[Hey ${task.assignee}, Do not forget about task "${task.name}". ${task.description}</p><p>                        Sent by JBoss jBPM</p><p>            ]]></text></p><p>        </mail-template></p><p>    </process-engine-context></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <transaction-context></p><p>        <repository-session /></p><p>        <db-session /></p><p>        <message-session /></p><p>        <timer-session /></p><p>        <history-sessions></p><p>            <object /></p><p>        </history-sessions></p><p>        <mail-session></p><p>            <mail-server></p><p>                <session-properties resource="jbpm.mail.properties" /></p><p>            </mail-server></p><p>        </mail-session></p><p>    </transaction-context></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <!--  <import resource="jbpm.variable.types.cfg.xml" /> --></p><p>    <import resource="jbpm.jpdl.cfg.xml" /></p><p>    <import resource="jbpm.tx.spring.cfg.xml" /></p><p>    <import resource="jbpm.identity.cfg.xml" /></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p></jbpm-configuration></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>The issue is present also on junit testing or using the webapp ...</p><p>Junit testing enviroment is based on AbstractJUnit4SpringContextTests .</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Here some sql printed by hibernate, as you asked:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Hibernate: <br/>    select<br/>        propertyim0_.KEY_ as KEY1_6_,<br/>        propertyim0_.VERSION_ as VERSION2_6_,<br/>        propertyim0_.VALUE_ as VALUE3_6_ <br/>    from<br/>        JBPM4_PROPERTY propertyim0_ limit ?<br/>Hibernate: <br/>    select<br/>        this_.KEY_ as KEY1_6_0_,<br/>        this_.VERSION_ as VERSION2_6_0_,<br/>        this_.VALUE_ as VALUE3_6_0_ <br/>    from<br/>        JBPM4_PROPERTY this_ <br/>    where<br/>        this_.KEY_=?<br/>Hibernate: <br/>    select<br/>        this_.KEY_ as KEY1_6_0_,<br/>        this_.VERSION_ as VERSION2_6_0_,<br/>        this_.VALUE_ as VALUE3_6_0_ <br/>    from<br/>        JBPM4_PROPERTY this_ <br/>    where<br/>        this_.KEY_=?<br/>Hibernate: <br/>    insert <br/>    into<br/>        JBPM4_PROPERTY<br/>        (VERSION_, VALUE_, KEY_) <br/>    values<br/>        (?, ?, ?)<br/>Hibernate: <br/>    select<br/>        this_.KEY_ as KEY1_6_0_,<br/>        this_.VERSION_ as VERSION2_6_0_,<br/>        this_.VALUE_ as VALUE3_6_0_ <br/>    from<br/>        JBPM4_PROPERTY this_ <br/>    where<br/>        this_.KEY_=?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Hibernate: <br/>    select<br/>        propertyim0_.KEY_ as KEY1_6_,<br/>        propertyim0_.VERSION_ as VERSION2_6_,<br/>        propertyim0_.VALUE_ as VALUE3_6_ <br/>    from<br/>        JBPM4_PROPERTY propertyim0_ <br/>    where<br/>        propertyim0_.KEY_='next.dbid'</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Do you see something wrong ?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Thanks in advance.</p><p>Stefano</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/539201#539201">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>