<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Activiti with Hibernate in Alfresco Archive</title>
    <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80454#M53700</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could think about a class which offers these implementations and all of your beans for extends these class. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then if you call a specific Method in the bean e.g. bean.save() which call commit() after do some stuff or bean.onError() if an error occurs an the it call rollback().&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;public class MyBean() extends BaseAction{&lt;BR /&gt; private MyObject pojo;&lt;BR /&gt; private MyService service;&lt;BR /&gt; private RuntimeService runtimeService;&lt;BR /&gt; …&lt;BR /&gt; &lt;BR /&gt; public void doSomeStuff() {&lt;BR /&gt;&amp;nbsp; pojo.setText("demo");&lt;BR /&gt;&amp;nbsp; pojo.setValue(42);&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; save(); // Or just call the save from your GUI for example&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; public void save() {&lt;BR /&gt;&amp;nbsp; try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; service.save(pojo);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; runtimeService.setVariable(pInst.getId(), "pojoid", pojo.getId());&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; commit();&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; catch(Exception e) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; onError(e);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; public void onError(Exception e) {&lt;BR /&gt;&amp;nbsp; // do some stuff&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; rollback();&lt;BR /&gt; }&lt;BR /&gt; …&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope you now understand how to use this methods, otherwise ask! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greets cookie-exploit&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Sep 2012 10:36:41 GMT</pubDate>
    <dc:creator>cookie-exploit</dc:creator>
    <dc:date>2012-09-07T10:36:41Z</dc:date>
    <item>
      <title>Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80446#M53692</link>
      <description>Hello guys,is it possible to use Activiti with hibernate instead of mybatis? And if it is possible, what I have to do to make it work?Greetz cookie-exploit</description>
      <pubDate>Thu, 02 Aug 2012 07:43:28 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80446#M53692</guid>
      <dc:creator>cookie-exploit</dc:creator>
      <dc:date>2012-08-02T07:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80447#M53693</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You'll have to replace the whole internals of activiti for this (alls sessions/managers and their factories), so it's possible but I guess it will take a *very* long time to do, possibly having to change a few bits here and there in the layers above. So my advice would be: don't do it &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://connect.hyland.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What's the use-case for using hibernate?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 11:57:01 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80447#M53693</guid>
      <dc:creator>frederikherema1</dc:creator>
      <dc:date>2012-08-02T11:57:01Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80448#M53694</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Probably some 'architect' or 'it manager' requires it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Aug 2012 21:09:22 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80448#M53694</guid>
      <dc:creator>ronald_van_kuij</dc:creator>
      <dc:date>2012-08-02T21:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80449#M53695</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;First of all, thanks for replies. &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The case is that we actually use hibernate and jbpm in our project and we not really want to use a lot of different frameworks, so it's would be nice to use hibernate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Now I had to talk with my project leader that it would be a long way to use activiti with hibernate and that he should think about to use myBatis.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Another Question: What was the intention to use for activiti myBatis instead of hibernate? Are there any benefits of myBatis over hibernate?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;EDIT: I forgot another important point, we actually use a single hibernate session for our persistence and jbpm persistence. That's a big problem, because we need this features.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 08 Aug 2012 10:02:00 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80449#M53695</guid>
      <dc:creator>cookie-exploit</dc:creator>
      <dc:date>2012-08-08T10:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80450#M53696</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You could still use the datasource in MyBatis, so technically there is no real disadvantage. The reason basically was:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Hibernate is LGPL, we want to have only ASL license dependencies -&amp;gt; Hibernate not possible&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- JPA would have been possible, BUT&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - MyBatis turned out to be much more flexible. we can do a lot of tweaking and tuning behind the scenes. See for example &lt;/SPAN&gt;&lt;A href="http://www.jorambarrez.be/blog/2012/06/28/the-activiti-performance-showdown/" rel="nofollow noopener noreferrer"&gt;http://www.jorambarrez.be/blog/2012/06/28/the-activiti-performance-showdown/&lt;/A&gt;&lt;SPAN&gt;, some of the improvements we did would not have been easily possible with JPA. Or take &lt;/SPAN&gt;&lt;A href="https://app.camunda.com/confluence/display/foxUserGuide/fox+cockpit" rel="nofollow noopener noreferrer"&gt;https://app.camunda.com/confluence/display/foxUserGuide/fox+cockpit&lt;/A&gt;&lt;SPAN&gt;, where we can click together sophisticated queries, we actually tried this with JPA, but MyBatis turned out to be waaaay easier. Last but not least Hibernate even caused some trouble with DB2-XA drivers, stuff you can easily fix on the MyBatis level, so I am pretty happy with myBatis at this moment. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; - And since we do not have a typical business application with a lot of entities, the pain of writing XML mappings is not that big.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Does this explain MyBatis? Till now that was never a showstopper in the projects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Bernd&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 05:40:53 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80450#M53696</guid>
      <dc:creator>bernd_ruecker</dc:creator>
      <dc:date>2012-08-14T05:40:53Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80451#M53697</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am having the same problem that you, about the session of Hiberate. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I need to use a single Hibernate session, and with activiti, i am not able to do this.&amp;nbsp; &lt;img id="smileysad" class="emoticon emoticon-smileysad" src="https://connect.hyland.com/i/smilies/16x16_smiley-sad.png" alt="Smiley Sad" title="Smiley Sad" /&gt;&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 Aug 2012 15:08:11 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80451#M53697</guid>
      <dc:creator>nandoztx</dc:creator>
      <dc:date>2012-08-14T15:08:11Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80452#M53698</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have solved the problem for our needs.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Now Activiti uses the HibernateTransactionManager and with that we can make a full rollback! Its not important that Activiti uses MyBatis, because after a small research about MyBatis I found out that MyBatis support the HibernateTransactionManager.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;ApplicationCotext:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;!– DataSource Definition –&amp;gt;&lt;BR /&gt;&amp;lt;bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"&amp;gt;&lt;BR /&gt; &amp;lt;property name="driverClassName" value="com.mysql.jdbc.Driver" /&amp;gt;&lt;BR /&gt; &amp;lt;property name="url" value="jdbc:mysql://localhost:3306/activiti"/&amp;gt;&lt;BR /&gt; &amp;lt;property name="username" value="root" /&amp;gt;&lt;BR /&gt; &amp;lt;property name="password" value="root" /&amp;gt;&lt;BR /&gt; &amp;lt;property name="poolPreparedStatements" value="true" /&amp;gt;&lt;BR /&gt; &amp;lt;property name="maxActive" value="50" /&amp;gt;&lt;BR /&gt; &amp;lt;property name="maxIdle" value="10" /&amp;gt;&lt;BR /&gt;&amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!– Session Factory Definition –&amp;gt;&lt;BR /&gt;&amp;lt;bean id="sessionFactory"&lt;BR /&gt; class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"&amp;gt;&lt;BR /&gt; &amp;lt;property name="dataSource"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;ref bean="dataSource" /&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt; …&lt;BR /&gt;&amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!– Hibernate Transaction Manager Definition –&amp;gt;&lt;BR /&gt;&amp;lt;bean id="transactionManager"&lt;BR /&gt; class="org.springframework.orm.hibernate3.HibernateTransactionManager"&amp;gt;&lt;BR /&gt; &amp;lt;property name="sessionFactory"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;ref local="sessionFactory" /&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt; &amp;lt;property name="dataSource"&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;ref local="dataSource" /&amp;gt;&lt;BR /&gt; &amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;BR /&gt;&amp;lt;!– Process Engine Definition –&amp;gt;&lt;BR /&gt;&amp;lt;bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"&amp;gt;&lt;BR /&gt; &amp;lt;property name="dataSource" ref="dataSource" /&amp;gt;&lt;BR /&gt; &amp;lt;property name="transactionManager" ref="transactionManager" /&amp;gt;&lt;BR /&gt; &amp;lt;property name="databaseSchemaUpdate" value="true" /&amp;gt;&lt;BR /&gt; &amp;lt;property name="jobExecutorActivate" value="false" /&amp;gt;&lt;BR /&gt;&amp;lt;/bean&amp;gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Methods for start and commit a transation (all Transactions done after startTransaction are commit after call commit Transaction):&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;protected TransactionStatus startTransaction() {&lt;BR /&gt; PlatformTransactionManager manager = getTransactionManager();&lt;BR /&gt; DefaultTransactionDefinition d = new DefaultTransactionDefinition();&lt;BR /&gt; d.setPropagationBehavior(DefaultTransactionDefinition.PROPAGATION_REQUIRES_NEW);&lt;BR /&gt;&lt;BR /&gt; transaction = manager.getTransaction(d);&lt;BR /&gt;&lt;BR /&gt; return transaction;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;protected void commit(TransactionStatus transaction) {&lt;BR /&gt; PlatformTransactionManager manager = getTransactionManager();&lt;BR /&gt; manager.commit(transaction);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;protected void rollback(TransactionStatus transaction) {&lt;BR /&gt; PlatformTransactionManager manager = getTransactionManager();&lt;BR /&gt; manager.rollback(transaction);&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;private PlatformTransactionManager getTransactionManager() {&lt;BR /&gt;&lt;BR /&gt; return (PlatformTransactionManager) this.appContext&lt;BR /&gt;&amp;nbsp;&amp;nbsp; .getBean("transactionManager");&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this helps anyone who have a problem to integrate activiti in a hibernate environment.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S.: I think it would be great if this method (or something like that) is also found in the activiti doucumentation, because lots of projects currently using hibernate for persitences and in the activit documentation doesn't exist a guide to integrate activiti in an hibernate environment.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 Aug 2012 11:27:24 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80452#M53698</guid>
      <dc:creator>cookie-exploit</dc:creator>
      <dc:date>2012-08-23T11:27:24Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80453#M53699</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi cookie-exploit,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I have no idea where to put these implementations commit and rollback.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Could be a little more specific?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 04 Sep 2012 12:15:37 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80453#M53699</guid>
      <dc:creator>nandoztx</dc:creator>
      <dc:date>2012-09-04T12:15:37Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80454#M53700</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You could think about a class which offers these implementations and all of your beans for extends these class. &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Then if you call a specific Method in the bean e.g. bean.save() which call commit() after do some stuff or bean.onError() if an error occurs an the it call rollback().&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;public class MyBean() extends BaseAction{&lt;BR /&gt; private MyObject pojo;&lt;BR /&gt; private MyService service;&lt;BR /&gt; private RuntimeService runtimeService;&lt;BR /&gt; …&lt;BR /&gt; &lt;BR /&gt; public void doSomeStuff() {&lt;BR /&gt;&amp;nbsp; pojo.setText("demo");&lt;BR /&gt;&amp;nbsp; pojo.setValue(42);&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; save(); // Or just call the save from your GUI for example&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; public void save() {&lt;BR /&gt;&amp;nbsp; try {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; service.save(pojo);&lt;BR /&gt;&amp;nbsp;&amp;nbsp; runtimeService.setVariable(pInst.getId(), "pojoid", pojo.getId());&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;&amp;nbsp; commit();&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; catch(Exception e) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp; onError(e);&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt; }&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; public void onError(Exception e) {&lt;BR /&gt;&amp;nbsp; // do some stuff&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; rollback();&lt;BR /&gt; }&lt;BR /&gt; …&lt;BR /&gt;}&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope you now understand how to use this methods, otherwise ask! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greets cookie-exploit&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Sep 2012 10:36:41 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80454#M53700</guid>
      <dc:creator>cookie-exploit</dc:creator>
      <dc:date>2012-09-07T10:36:41Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80455#M53701</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for you reply, but i don't understand yet =/&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I don't use spring like that, so i use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;applicationContext.xml:&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;&lt;BR /&gt;&amp;lt;bean id="dataSource"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class="com.mchange.v2.c3p0.ComboPooledDataSource"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="driverClass" value="${database.driver}" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="jdbcUrl" value="${database.url}" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="user" value="${database.username}" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="password" value="${database.password}" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="initialPoolSize" value="3" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="minPoolSize" value="1" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="maxPoolSize" value="17" /&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;BR /&gt;…&lt;BR /&gt;&amp;lt;tx:annotation-driven transaction-manager="transactionManager" mode="aspectj"/&amp;gt;&lt;BR /&gt;…&lt;BR /&gt;&amp;lt;bean id="transactionManager"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class="org.springframework.orm.hibernate3.HibernateTransactionManager"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="dataSource" ref="dataSource" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="sessionFactory" ref="sessionFactory" /&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;BR /&gt;…&lt;BR /&gt;&amp;lt;bean&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; class="org.springframework.transaction.aspectj.AnnotationTransactionAspect"&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; factory-method="aspectOf"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="transactionManager"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;ref local="transactionManager" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/property&amp;gt;&lt;BR /&gt;&amp;nbsp; &amp;lt;/bean&amp;gt;&lt;BR /&gt;…&lt;BR /&gt; &amp;lt;bean id="processEngineConfiguration" class="org.activiti.spring.SpringProcessEngineConfiguration"&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="databaseType" value="postgres" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="dataSource" ref="dataSource" /&amp;gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;property name="transactionManager" ref="transactionManager" /&amp;gt;&lt;BR /&gt;…&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;and to open a transaction so i use:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;&amp;nbsp;&amp;nbsp; @Override&lt;BR /&gt; @Transactional&lt;BR /&gt; public ProcessInstance startWorkflowProcess(String processDefinitionId, Map&amp;lt;String, Object&amp;gt; variables, String currentUser){&lt;BR /&gt;&amp;nbsp; log.debug("Starting new process with the id: "+processDefinitionId+" and the variables are :"+variables);&lt;BR /&gt;&amp;nbsp; identityService.setAuthenticatedUserId(currentUser);&lt;BR /&gt;&amp;nbsp; ProcessInstance processInstance = runtimeService.startProcessInstanceById(processDefinitionId, variables);&lt;BR /&gt;&amp;nbsp; identityService.setAuthenticatedUserId(null);&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; return processInstance;&lt;BR /&gt; }&lt;BR /&gt;&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;The only thing that i use to manage my transactions is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;CODE&gt;import org.hibernate.Session;&lt;BR /&gt;import org.hibernate.SessionFactory;&lt;BR /&gt;import org.springframework.beans.factory.annotation.Autowired;&lt;BR /&gt;&lt;BR /&gt;public class JPASessionFactory {&lt;BR /&gt;&lt;BR /&gt; @Autowired&lt;BR /&gt; private SessionFactory sessionFactory;&lt;BR /&gt;&lt;BR /&gt; public Session getCurrentSession() {&lt;BR /&gt;&amp;nbsp; return sessionFactory.getCurrentSession();&lt;BR /&gt; }&lt;BR /&gt;&lt;BR /&gt; public SessionFactory getSessionFactory() {&lt;BR /&gt;&amp;nbsp; return sessionFactory;&lt;BR /&gt; }&lt;BR /&gt;}&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Sep 2012 14:31:59 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80455#M53701</guid>
      <dc:creator>nandoztx</dc:creator>
      <dc:date>2012-09-10T14:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80456#M53702</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It's important to know, what you want to do in a single Transaction. Because with my Method you start a Transaction with my Method and then all database manipulation will done in proxy objects, so that the real manipulation is done if you said commit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You can think about using a transaction whenever you edit something. I use conversations to manage my transactions, but as a simple example you can start a new session for every "bean" you show, that is what I did with the conversations.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Examples:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;1. You have an address book and then say to edit an contact. If you done this you create a new Transaction for the showed edit dialog and call commit if you save and rollback if you cancel the dialog or an error in the saving method occur.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;2. You have an content management system and want to edit a file. If you start to edit something related to the file, you start an new transaction. Then you save the edited things, start the approve process, that the current state ist the "review" state. After that is done you can call commit to commit the changes you done with your objects and the activiti engine does with their objects. Remember that you had to call the save methods of your services to save your own objects, before you call commit.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I hope this examples helps you a bit! &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://connect.hyland.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Greets cookie-exploit&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 13 Sep 2012 08:50:16 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80456#M53702</guid>
      <dc:creator>cookie-exploit</dc:creator>
      <dc:date>2012-09-13T08:50:16Z</dc:date>
    </item>
    <item>
      <title>Re: Activiti with Hibernate</title>
      <link>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80457#M53703</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for your patience!&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The problem I have with the transaction is as follows: within a servieTask I'm doing a query with hibernate.&lt;/SPAN&gt;&lt;BR /&gt;&lt;CODE&gt;public void execute(DelegateExecution execution) throws Exception {&lt;BR /&gt;&amp;nbsp; &lt;BR /&gt;&amp;nbsp; Version version = versionService.findDistributionVersion("Test");&lt;BR /&gt;&amp;nbsp; System.err.println(version);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/CODE&gt;&lt;BR /&gt;&lt;SPAN&gt;and when I stress test with multiple simultaneous threads, I have a connection deadlock, because I do a query (using hibernate), it opens a new DB transaction and don't use the transaction that was already opened by Activiti.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It's possible I do this?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 17 Sep 2012 11:49:33 GMT</pubDate>
      <guid>https://connect.hyland.com/t5/alfresco-archive/activiti-with-hibernate/m-p/80457#M53703</guid>
      <dc:creator>nandoztx</dc:creator>
      <dc:date>2012-09-17T11:49:33Z</dc:date>
    </item>
  </channel>
</rss>

