<!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;">
Re: jbpmContext.getSessionFactory().openSession() and jbpmConte
</h3>
<span style="margin-bottom: 10px;">
created by <a href="http://community.jboss.org/people/harishpandya">Harry P.</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/602637#602637">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 Anurag, </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>I was facing "Unable to Locate current JTA transaction" error.</p><p>So i changed the </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><field name=<span style="color: #ff0000;">"isCurrentSessionEnabled"</span>><<span style="color: #000080;"><strong>true</strong></span> /></field> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>property of jbpm.cfg.xml to <span style="text-decoration: underline;"><strong>false. </strong></span></p><p style="min-;"><span style="text-decoration: underline;"><strong> </strong></span> </p><p>Now my jbpm transactions are not getting commited.</p><p>I tried following thing</p><ul><li>Saved process Instance</li><li>Inserted session manually through hibernate SessionFactory</li><li>Explicitally commited jbpm transaction</li></ul><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>But nothing helped me out.</p><p>I am using JTA transaction.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>So can you help me.</p><p>My jbpm.cfg.xml file is as follow</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><jbpm-configuration></p><p>  <!-- <br/>    The default configurations can be found in org/jbpm/default.jbpm.cfg.xml <br/>    Those configurations can be overwritten by putting this file called <br/>    jbpm.cfg.xml on the root of the classpath and put in the customized values.<br/>  --></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>  <jbpm-context><br/>   <service name="persistence"><br/>      <factory><br/>        <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory"><br/>          <field name="isTransactionEnabled"><false /></field><br/>          <field name="isCurrentSessionEnabled"><false /></field><br/>        </bean><br/>      </factory><br/>    </service><br/>    <service name="tx" factory="org.jbpm.tx.TxServiceFactory" /><br/>    <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" /><br/>    <service name="scheduler" factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" /><br/>    <service name="authentication" factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory" /><br/>  </jbpm-context></p><p>  <!-- configuration resource files pointing to default configuration files in jbpm-{version}.jar --><br/><string name="resource.hibernate.cfg.xml" value="/hibernate.cfg.xml" /><br/>   <string name="resource.business.calendar" value="org/jbpm/calendar/jbpm.business.calendar.properties" /><br/>  <string name="resource.default.modules" value="org/jbpm/graph/def/jbpm.default.modules.properties" /><br/>  <string name="resource.converter" value="org/jbpm/db/hibernate/jbpm.converter.properties" /><br/>  <string name="resource.action.types" value="org/jbpm/graph/action/action.types.xml" /><br/>  <string name="resource.node.types" value="org/jbpm/graph/node/node.types.xml" /><br/>  <string name="resource.parsers" value="org/jbpm/jpdl/par/jbpm.parsers.xml" /><br/>  <string name="resource.varmapping" value="org/jbpm/context/exe/jbpm.varmapping.xml" /></p><p>  <bean name="jbpm.task.instance.factory" class="org.jbpm.taskmgmt.impl.DefaultTaskInstanceFactoryImpl" singleton="true" /><br/>  <bean name="jbpm.variable.resolver" class="org.jbpm.jpdl.el.impl.JbpmVariableResolver" singleton="true" /><br/>   <bean name="jbpm.job.executor" class="org.jbpm.job.executor.JobExecutor"> <br/>  <field name="jbpmConfiguration"> <ref bean="jbpmConfiguration"/> </field> <br/>  <field name="name"> <string value="JbpmJobExector"/> </field> <br/>  <field name="nbrOfThreads"> <int value="1"/> </field> <br/>  <field name="idleInterval"> <int value="5000"/> </field> <br/>  <field name="maxIdleInterval"> <int value="3600000"/> </field> <!-- 1 hour --> <br/>  <field name="historyMaxSize"> <int value="20"/> </field> <br/>  <field name="maxLockTime"> <int value="600000"/> </field> <!-- 10 minutes --> <br/>  <field name="lockMonitorInterval"> <int value="60000"/> </field> <!-- 1 minute --> <br/>  <field name="lockBufferTime"> <int value="5000"/> </field> <!-- 5 seconds --> <br/></bean><br/>  <long name="jbpm.msg.wait.timout" value="5000" singleton="true" /></p><p></jbpm-configuration></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>HIbernate.cfg.xml is::></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><?xml version='1.0' encoding='utf-8'?><br/><!DOCTYPE hibernate-configuration PUBLIC<br/>  "-//Hibernate/Hibernate Configuration DTD 3.0//EN"<br/>  "<a class="jive-link-external-small" href="http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd</a>"><br/><hibernate-configuration><br/>  <session-factory><br/>    <property name="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</property><br/><property name="connection.driver_class">oracle.jdbc.xa.client.OracleXADataSource</property></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>    <property name="hibernate.cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property><br/>    <br/><property name="hibernate.jdbc.batch_size">0</property><br/>     <br/>     <property name="hibernate.connection.datasource">java:datasource</property><br/>     <br/>  <property name="hibernate.connection.pool_size">10</property></p><p>  <property name="hibernate.transaction.manager_lookup_class">org.hibernate.transaction.JBossTransactionManagerLookup</property> <br/><property name="transaction.factory_class">org.hibernate.transaction.JTATransactionFactory</property><br/>     <property name="hibernate.hbm2ddl.auto">update</property></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>     <property name="hibernate.format_sql">true</property><br/>    <property name="hibernate.use_sql_comments">true</property></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><property name="hibernate.show_sql">true</property><br/><property name="hibernate.current_session_context_class">managed</property></p><p>       <mapping resource="hibernate.extra.hbm.xml" /><br/>    <mapping resource="hibernate.identity.hbm.xml" /></p><p>      <mapping resource="org/jbpm/db/hibernate.types.hbm.xml" /></p><p>       <mapping resource="org/jbpm/graph/action/MailAction.hbm.xml"/></p><p>       <mapping resource="org/jbpm/graph/def/ProcessDefinition.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/def/Node.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/def/Transition.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/def/Event.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/def/Action.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/def/SuperState.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/def/ExceptionHandler.hbm.xml"/><br/>    <mapping resource="org/jbpm/instantiation/Delegation.hbm.xml"/></p><p>    <mapping resource="org/jbpm/graph/node/StartState.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/node/EndState.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/node/ProcessState.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/node/Decision.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/node/Fork.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/node/Join.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/node/MailNode.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/node/State.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/node/TaskNode.hbm.xml"/></p><p>    <mapping resource="org/jbpm/context/def/ContextDefinition.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/def/VariableAccess.hbm.xml"/></p><p>    <!-- bytes mapping files --><br/>    <mapping resource="org/jbpm/bytes/ByteArray.hbm.xml"/></p><p>    <!-- module.def mapping files --><br/>    <mapping resource="org/jbpm/module/def/ModuleDefinition.hbm.xml"/></p><p>    <!-- file.def mapping files --><br/>    <mapping resource="org/jbpm/file/def/FileDefinition.hbm.xml"/></p><p>     <mapping resource="org/jbpm/taskmgmt/def/TaskMgmtDefinition.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/def/Swimlane.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/def/Task.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/def/TaskController.hbm.xml"/></p><p>    <mapping resource="org/jbpm/scheduler/def/CreateTimerAction.hbm.xml"/><br/>    <mapping resource="org/jbpm/scheduler/def/CancelTimerAction.hbm.xml"/></p><p>    <mapping resource="org/jbpm/graph/exe/Comment.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/exe/ProcessInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/exe/Token.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/exe/RuntimeAction.hbm.xml"/></p><p>    <mapping resource="org/jbpm/module/exe/ModuleInstance.hbm.xml"/></p><p>    <mapping resource="org/jbpm/context/exe/ContextInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/exe/TokenVariableMap.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/exe/VariableInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/exe/variableinstance/ByteArrayInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/exe/variableinstance/DateInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/exe/variableinstance/DoubleInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/exe/variableinstance/HibernateLongInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/exe/variableinstance/HibernateStringInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/exe/variableinstance/LongInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/exe/variableinstance/NullInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/exe/variableinstance/StringInstance.hbm.xml"/></p><p>    <mapping resource="org/jbpm/job/Job.hbm.xml"/><br/>    <mapping resource="org/jbpm/job/Timer.hbm.xml"/><br/>    <mapping resource="org/jbpm/job/ExecuteNodeJob.hbm.xml"/><br/>    <mapping resource="org/jbpm/job/ExecuteActionJob.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/exe/TaskMgmtInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/exe/TaskInstance.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/exe/PooledActor.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/exe/SwimlaneInstance.hbm.xml"/></p><p>    <mapping resource="org/jbpm/logging/log/ProcessLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/logging/log/MessageLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/logging/log/CompositeLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/log/ActionLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/log/NodeLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/log/ProcessInstanceCreateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/log/ProcessInstanceEndLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/log/ProcessStateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/log/SignalLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/log/TokenCreateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/log/TokenEndLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/graph/log/TransitionLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/VariableLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/VariableCreateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/VariableDeleteLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/VariableUpdateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/variableinstance/ByteArrayUpdateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/variableinstance/DateUpdateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/variableinstance/DoubleUpdateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/variableinstance/HibernateLongUpdateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/variableinstance/HibernateStringUpdateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/variableinstance/LongUpdateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/context/log/variableinstance/StringUpdateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/log/TaskLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/log/TaskCreateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/log/TaskAssignLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/log/TaskEndLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/log/SwimlaneLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/log/SwimlaneCreateLog.hbm.xml"/><br/>    <mapping resource="org/jbpm/taskmgmt/log/SwimlaneAssignLog.hbm.xml"/></p><p>    <class-cache class="org.jbpm.bytes.ByteArray" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.bytes.ByteArray.byteBlocks" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.context.def.VariableAccess" usage="nonstrict-read-write" /></p><p>    <collection-cache collection="org.jbpm.file.def.FileDefinition.processFiles" usage="nonstrict-read-write" /></p><p>    <collection-cache collection="org.jbpm.graph.action.Script.variableAccesses" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.graph.def.Action" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.graph.def.Event" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.Event.actions" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.graph.def.ExceptionHandler" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.ExceptionHandler.actions" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.graph.def.Node" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.Node.events" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.Node.exceptionHandlers" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.Node.leavingTransitions" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.Node.arrivingTransitions" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.graph.def.ProcessDefinition" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.ProcessDefinition.events" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.ProcessDefinition.exceptionHandlers" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.ProcessDefinition.nodes" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.ProcessDefinition.actions" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.ProcessDefinition.definitions" usage="nonstrict-read-write" /></p><p>    <collection-cache collection="org.jbpm.graph.def.SuperState.nodes" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.graph.def.Transition" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.Transition.events" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.graph.def.Transition.exceptionHandlers" usage="nonstrict-read-write" /></p><p>    <collection-cache collection="org.jbpm.graph.node.Decision.decisionConditions" usage="nonstrict-read-write" /></p><p>    <collection-cache collection="org.jbpm.graph.node.ProcessState.variableAccesses" usage="nonstrict-read-write" /></p><p>    <collection-cache collection="org.jbpm.graph.node.TaskNode.tasks" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.instantiation.Delegation" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.module.def.ModuleDefinition" usage="nonstrict-read-write" /></p><p>    <collection-cache collection="org.jbpm.taskmgmt.def.Swimlane.tasks" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.taskmgmt.def.TaskController" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.taskmgmt.def.TaskController.variableAccesses" usage="nonstrict-read-write" /></p><p>    <class-cache class="org.jbpm.taskmgmt.def.Task" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.taskmgmt.def.Task.events" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.taskmgmt.def.Task.exceptionHandlers" usage="nonstrict-read-write" /></p><p>    <collection-cache collection="org.jbpm.taskmgmt.def.TaskMgmtDefinition.swimlanes" usage="nonstrict-read-write" /><br/>    <collection-cache collection="org.jbpm.taskmgmt.def.TaskMgmtDefinition.tasks" usage="nonstrict-read-write" /><br/>  </session-factory><br/></hibernate-configuration></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/602637#602637">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>