<!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;">
    jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/zerkowski.maciek">Maciej Zerkowski</a> in <i>jBPM</i> - <a href="http://community.jboss.org/message/582327#582327">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&lt;!<del><a class="" href="http://community.jboss.org/message/582327#582327">jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)</a>&gt;&lt;xml&gt; &lt;o:OfficeDocumentSettings&gt;&#160;&#160; &lt;o:RelyOnVML /&gt;&#160;&#160; &lt;o:AllowPNG /&gt;&#160;&#160; &lt;o:DoNotRelyOnCSS /&gt; &lt;/o:OfficeDocumentSettings&gt; &lt;/xml&gt;&lt;![endif]</del>&gt;&lt;!<del><a class="" href="http://community.jboss.org/message/582327#582327">jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)</a>&gt;&lt;xml&gt; &lt;w:WordDocument&gt;&#160;&#160; &lt;w:View&gt;Normal&lt;/w:View&gt;&#160;&#160; &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;&#160;&#160; &lt;w:PunctuationKerning /&gt;&#160;&#160; &lt;w:ValidateAgainstSchemas /&gt;&#160;&#160; &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;&#160;&#160; &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;&#160;&#160; &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;&#160;&#160; &lt;w:Compatibility&gt;&#160;&#160;&#160; &lt;w:BreakWrappedTables /&gt;&#160;&#160;&#160; &lt;w:SnapToGridInCell /&gt;&#160;&#160;&#160; &lt;w:WrapTextWithPunct /&gt;&#160;&#160;&#160; &lt;w:UseAsianBreakRules /&gt;&#160;&#160;&#160; &lt;w:DontGrowAutofit /&gt;&#160;&#160;&#160; &lt;w:UseFELayout /&gt;&#160;&#160; &lt;/w:Compatibility&gt;&#160;&#160; &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt; &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]</del>&gt;&lt;!<del><a class="" href="http://community.jboss.org/message/582327#582327">jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)</a>&gt;&lt;xml&gt; &lt;w:LatentStyles DefLockedState="false" LatentStyleCount="156"&gt; &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]</del>&gt;&lt;!<del><a class="" href="http://community.jboss.org/message/582327#582327">jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)</a>&gt; &lt;mce:style&gt;&lt;!&#160;&#160; /* Style Definitions */&#160; table.MsoNormalTable &#160;&#160;&#160;&#160;&#160;{mso-style-name:"Table Normal"; &#160;&#160;&#160;&#160;&#160;mso-tstyle-rowband-size:0; &#160;&#160;&#160;&#160;&#160;mso-tstyle-colband-size:0; &#160;&#160;&#160;&#160;&#160;mso-style-noshow:yes; &#160;&#160;&#160;&#160;&#160;mso-style-parent:""; &#160;&#160;&#160;&#160;&#160;mso-padding-alt:0cm 5.4pt 0cm 5.4pt; &#160;&#160;&#160;&#160;&#160;mso-para-margin:0cm; &#160;&#160;&#160;&#160;&#160;mso-para-margin-bottom:.0001pt; &#160;&#160;&#160;&#160;&#160;mso-pagination:widow-orphan; &#160;&#160;&#160;&#160;&#160;font-size:10.0pt; &#160;&#160;&#160;&#160;&#160;font-family:"Times New Roman"; &#160;&#160;&#160;&#160;&#160;mso-ansi-language:#0400; &#160;&#160;&#160;&#160;&#160;mso-fareast-language:#0400; &#160;&#160;&#160;&#160;&#160;mso-bidi-language:#0400;}&#160; &gt;&lt;/mce:style&gt;&lt;mce:style&#160; <u>mce</u>bogus="1"&gt;&lt;!</del>&gt;</p><p><p>--&gt;</p></p><p>&lt;!<del><a class="" href="http://community.jboss.org/message/582327#582327">jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)</a></del>&gt;</p><p><p><span style="font-family: Arial; font-size: 10pt;"><span style="font-size: 10pt; font-family: Arial;">Hello all!</span></span></p></p><p><br/></p><p><p><span style="font-family: Arial; font-size: 10pt;"><span style="font-size: 10pt; font-family: Arial;"><br/></span></span></p></p><p><br/></p><p><p><span style="font-family: Arial; font-size: 10pt;"><span style="font-size: 10pt; font-family: Arial;">I have a question regarding configuration jBPM 3.2.6.SP1 with JPA2 (Hibernate implementation). I am new in jBPM and I would like to ask you how can I do that in a proper way? You can find my configuration bellow. <span></span></span></span></p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p><p><span style="font-family: Arial; font-size: 10pt;"><span style="font-size: 10pt; font-family: Arial;">What I would also like to know is &ndash; what in your opinion is the best approach to integrate jBPM with the web application (like in my case) - to integrate my persistent classes with the jBPM persistent classes and have one entity manager factory (hibernate session factory) or to use two data sources and synchronize transactions somehow.</span></span></p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p><p><span style="font-family: Arial; font-size: 10pt;"><span style="font-size: 10pt; font-family: Arial;">Can you give me some examples or links or maybe you have some tips or suggestions what is the best way (and how) to do this?</span></span></p></p><p><br/></p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="font-family: Arial; font-size: 10pt;"><span style="font-size: 10pt; font-family: Arial;"></span></span>&#160;</p></p><p><br/></p><p><p><span style="font-family: Arial; font-size: 10pt;"><span style="font-size: 10pt; font-family: Arial;">I appreciate any help.</span></span></p></p><p><br/></p><p><p style="min-height: 8pt; height: 8pt; padding: 0px;"><span style="font-family: Arial; font-size: 10pt;"><span style="font-size: 10pt; font-family: Arial;"></span></span>&#160;</p></p><p><br/></p><p><p><span style="font-family: Arial; font-size: 10pt;"><span style="font-size: 10pt; font-family: Arial;">Regards,</span></span></p></p><p><br/></p><p><p><span style="font-family: Arial; font-size: 10pt;"><span style="font-size: 10pt; font-family: Arial;">Maciek</span></span></p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>my <strong>applicationContext.xml:</strong><br/><br/><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p><p>&lt;bean id="dataSource" class="org.springframework.</p></p><p><br/></p><p id=":104"><p>jndi.JndiObjectFactoryBean"&gt;<br/> &lt;property name="jndiName" value="java:comp/env/jdbc/db" /&gt;<br/>&lt;/bean&gt;</p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p><p>&lt;bean id="entityManagerFactory"<br/> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;<br/> &lt;property name="dataSource" ref="dataSource" /&gt;<br/> &lt;property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" /&gt;<br/> &lt;property name="jpaVendorAdapter"&gt;<br/> &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;<br/> &lt;/bean&gt;<br/> &lt;/property&gt;<br/> &lt;property name="jpaProperties"&gt;<br/> &lt;props&gt;<br/> &lt;prop key="database"&gt;...&lt;/prop&gt;<br/> ...<br/> &lt;/props&gt;<br/> &lt;/property&gt;<br/> &lt;/bean&gt;</p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p><p>&lt;bean id="transactionManager"<br/> class="org.springframework.orm.jpa.JpaTransactionManager"&gt;<br/> &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;<br/> &lt;/bean&gt;</p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p><p>&lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;</p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>my <strong>persistence.xml:</strong><br/><br/><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p><p>&lt;persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL"&gt;<br/> &lt;class&gt;com.myDVDStore...&lt;/class&gt;<br/> ...<br/> &lt;/persistence-unit&gt;</p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p><p>my</p></p><p><strong>&lt;span style="color: #333333;"&gt;jbpm.cfg.xml:&lt;/span&gt;</strong><br/><br/><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p><p>&lt;jbpm-context&gt;<br/> &lt;service name="authentication"<br/>factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory"<br/>/&gt;<br/> &lt;service name="logging"<br/>factory="org.jbpm.logging.db.DbLoggingServiceFactory" /&gt;<br/> &lt;service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" /&gt;<br/> &lt;service name="persistence"&gt;<br/> &lt;factory&gt;<br/> &lt;bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory"&gt; // I probably need to extend this to put my service there?<br/> &lt;field name="isTransactionEnabled"&gt;<br/> &lt;false /&gt;<br/> &lt;/field&gt;<br/> &lt;/bean&gt;<br/> &lt;/factory&gt;<br/> &lt;/service&gt;<br/> &lt;service name="tx" factory="org.jbpm.tx.TxServiceFactory" /&gt;<br/> &lt;service name="scheduler"<br/>factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" /&gt;<br/> &lt;/jbpm-context&gt;</p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/></p><div class="mcePaste" id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;"><p>&lt;bean id="dataSource" class="org.springframework.<br/></p><div id=":104"><p>jndi.JndiObjectFactoryBean"&gt;<br/> &lt;property name="jndiName" value="java:comp/env/jdbc/db" /&gt;<br/> &lt;/bean&gt;<br/><br/> &lt;bean id="entityManagerFactory"<br/> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"&gt;<br/> &lt;property name="dataSource" ref="dataSource" /&gt;<br/> &lt;property name="persistenceXmlLocation"<br/> value="classpath:META-INF/persistence.xml" /&gt;<br/> &lt;property name="jpaVendorAdapter"&gt;<br/> &lt;bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"&gt;<br/> &lt;/bean&gt;<br/> &lt;/property&gt;<br/> &lt;property name="jpaProperties"&gt;<br/> &lt;props&gt;<br/> &lt;prop key="database"&gt;...&lt;/prop&gt;<br/> ...<br/> &lt;/props&gt;<br/> &lt;/property&gt;<br/> &lt;/bean&gt;<br/><br/> &lt;bean id="transactionManager"<br/> class="org.springframework.orm.jpa.JpaTransactionManager"&gt;<br/> &lt;property name="entityManagerFactory" ref="entityManagerFactory" /&gt;<br/> &lt;/bean&gt;<br/><br/> my persistence.xml:<br/><br/> &lt;persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL"&gt;<br/> &lt;class&gt;...&lt;/class&gt;<br/> ...<br/> &lt;/persistence-unit&gt;<br/><br/> my jbpm.cfg.xml<br/><br/> &lt;jbpm-context&gt;<br/> &lt;service name="authentication"<br/> factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory"<br/> /&gt;<br/> &lt;service name="logging"<br/> factory="org.jbpm.logging.db.DbLoggingServiceFactory" /&gt;<br/> &lt;service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" /&gt;<br/> &lt;service name="persistence"&gt;<br/> &lt;factory&gt;<br/> &lt;bean class="com.myapp.JpaDbPersistenceServiceFactory"&gt; // I<br/> probably need to extend this to put my service there?<br/> &lt;field name="isTransactionEnabled"&gt;<br/> &lt;false /&gt;<br/> &lt;/field&gt;<br/> &lt;/bean&gt;<br/> &lt;/factory&gt;<br/> &lt;/service&gt;<br/> &lt;service name="tx" factory="org.jbpm.tx.TxServiceFactory" /&gt;<br/> &lt;service name="scheduler"<br/> factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" /&gt;<br/> &lt;/jbpm-context&gt;<br/><br/> &lt;tx:annotation-driven transaction-manager="transactionManager" /&gt;</p></div><p><br/></p></div><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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/582327#582327">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>