<!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;"> </p><p><!<del><a class="" href="http://community.jboss.org/message/582327#582327">jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)</a>><xml> <o:OfficeDocumentSettings>   <o:RelyOnVML />   <o:AllowPNG />   <o:DoNotRelyOnCSS /> </o:OfficeDocumentSettings> </xml><![endif]</del>><!<del><a class="" href="http://community.jboss.org/message/582327#582327">jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)</a>><xml> <w:WordDocument>   <w:View>Normal</w:View>   <w:Zoom>0</w:Zoom>   <w:PunctuationKerning />   <w:ValidateAgainstSchemas />   <w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>   <w:IgnoreMixedContent>false</w:IgnoreMixedContent>   <w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>   <w:Compatibility>    <w:BreakWrappedTables />    <w:SnapToGridInCell />    <w:WrapTextWithPunct />    <w:UseAsianBreakRules />    <w:DontGrowAutofit />    <w:UseFELayout />   </w:Compatibility>   <w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel> </w:WordDocument> </xml><![endif]</del>><!<del><a class="" href="http://community.jboss.org/message/582327#582327">jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)</a>><xml> <w:LatentStyles DefLockedState="false" LatentStyleCount="156"> </w:LatentStyles> </xml><![endif]</del>><!<del><a class="" href="http://community.jboss.org/message/582327#582327">jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)</a>> <mce:style><!   /* Style Definitions */  table.MsoNormalTable      {mso-style-name:"Table Normal";      mso-tstyle-rowband-size:0;      mso-tstyle-colband-size:0;      mso-style-noshow:yes;      mso-style-parent:"";      mso-padding-alt:0cm 5.4pt 0cm 5.4pt;      mso-para-margin:0cm;      mso-para-margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:10.0pt;      font-family:"Times New Roman";      mso-ansi-language:#0400;      mso-fareast-language:#0400;      mso-bidi-language:#0400;}  ></mce:style><mce:style  <u>mce</u>bogus="1"><!</del>></p><p><p>--></p></p><p><!<del><a class="" href="http://community.jboss.org/message/582327#582327">jBPM3 with JPA2 (+Spring3, JBoss 4.2.3)</a></del>></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;"> </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 – 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;"> </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> </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> </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;"> </p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>my <strong>applicationContext.xml:</strong><br/><br/><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><p><p><bean id="dataSource" class="org.springframework.</p></p><p><br/></p><p id=":104"><p>jndi.JndiObjectFactoryBean"><br/> <property name="jndiName" value="java:comp/env/jdbc/db" /><br/></bean></p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><p><p><bean id="entityManagerFactory"<br/> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"><br/> <property name="dataSource" ref="dataSource" /><br/> <property name="persistenceXmlLocation" value="classpath:META-INF/persistence.xml" /><br/> <property name="jpaVendorAdapter"><br/> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"><br/> </bean><br/> </property><br/> <property name="jpaProperties"><br/> <props><br/> <prop key="database">...</prop><br/> ...<br/> </props><br/> </property><br/> </bean></p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><p><p><bean id="transactionManager"<br/> class="org.springframework.orm.jpa.JpaTransactionManager"><br/> <property name="entityManagerFactory" ref="entityManagerFactory" /><br/> </bean></p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><p><p><tx:annotation-driven transaction-manager="transactionManager" /></p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>my <strong>persistence.xml:</strong><br/><br/><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><p><p><persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL"><br/> <class>com.myDVDStore...</class><br/> ...<br/> </persistence-unit></p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><p><p>my</p></p><p><strong><span style="color: #333333;">jbpm.cfg.xml:</span></strong><br/><br/><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><p><p><jbpm-context><br/> <service name="authentication"<br/>factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory"<br/>/><br/> <service name="logging"<br/>factory="org.jbpm.logging.db.DbLoggingServiceFactory" /><br/> <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" /><br/> <service name="persistence"><br/> <factory><br/> <bean class="org.jbpm.persistence.db.DbPersistenceServiceFactory"> // I probably need to extend this to put my service there?<br/> <field name="isTransactionEnabled"><br/> <false /><br/> </field><br/> </bean><br/> </factory><br/> </service><br/> <service name="tx" factory="org.jbpm.tx.TxServiceFactory" /><br/> <service name="scheduler"<br/>factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" /><br/> </jbpm-context></p></p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><br/></p><div class="mcePaste" id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow: hidden;"><p><bean id="dataSource" class="org.springframework.<br/></p><div id=":104"><p>jndi.JndiObjectFactoryBean"><br/> <property name="jndiName" value="java:comp/env/jdbc/db" /><br/> </bean><br/><br/> <bean id="entityManagerFactory"<br/> class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"><br/> <property name="dataSource" ref="dataSource" /><br/> <property name="persistenceXmlLocation"<br/> value="classpath:META-INF/persistence.xml" /><br/> <property name="jpaVendorAdapter"><br/> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"><br/> </bean><br/> </property><br/> <property name="jpaProperties"><br/> <props><br/> <prop key="database">...</prop><br/> ...<br/> </props><br/> </property><br/> </bean><br/><br/> <bean id="transactionManager"<br/> class="org.springframework.orm.jpa.JpaTransactionManager"><br/> <property name="entityManagerFactory" ref="entityManagerFactory" /><br/> </bean><br/><br/> my persistence.xml:<br/><br/> <persistence-unit name="persistenceUnit" transaction-type="RESOURCE_LOCAL"><br/> <class>...</class><br/> ...<br/> </persistence-unit><br/><br/> my jbpm.cfg.xml<br/><br/> <jbpm-context><br/> <service name="authentication"<br/> factory="org.jbpm.security.authentication.DefaultAuthenticationServiceFactory"<br/> /><br/> <service name="logging"<br/> factory="org.jbpm.logging.db.DbLoggingServiceFactory" /><br/> <service name="message" factory="org.jbpm.msg.db.DbMessageServiceFactory" /><br/> <service name="persistence"><br/> <factory><br/> <bean class="com.myapp.JpaDbPersistenceServiceFactory"> // I<br/> probably need to extend this to put my service there?<br/> <field name="isTransactionEnabled"><br/> <false /><br/> </field><br/> </bean><br/> </factory><br/> </service><br/> <service name="tx" factory="org.jbpm.tx.TxServiceFactory" /><br/> <service name="scheduler"<br/> factory="org.jbpm.scheduler.db.DbSchedulerServiceFactory" /><br/> </jbpm-context><br/><br/> <tx:annotation-driven transaction-manager="transactionManager" /></p></div><p><br/></p></div><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </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>