| Transaction Management with Virgo [message #990579] |
Thu, 13 December 2012 04:36  |
Erik Vande Velde Messages: 60 Registered: September 2012 |
Member |
|
|
In our application we have a core bundle managing the persistence / entities in the database. The application context (= attached) contains the definitions of the EntityManagerFactory and corresponding transaction manager. On top of core we have a service bundle with services that start a transaction, but somehow this doesn't work. When the core bundle executes a query on the database the entities in the result set appear not to be managed (contained in persistence context). We suspect the transaction is not propagated properly from the service to the core bundle.
What is the standard virgo way of implementing transactional services?
|
|
|
| Re: Transaction Management with Virgo [message #991427 is a reply to message #990579] |
Tue, 18 December 2012 23:03   |
Dmitry Sklyut Messages: 252 Registered: January 2010 |
Senior Member |
|
|
Would you mind sharing your service bundle config? My guess is that you do not give service bundle a reference to the txManager created in code bundle.
Generally you would need to publish your EntityManagerFactory and TransactionManager as an osgi service to be used by other bundles.
In service bundle do:
<osgi:reference id="txManager" interface="o.s.f...PlatformTransactionManager"/>
<tx:annotation-driven transaction-manager="txManager"/>
Regards,
Dmitry
[Updated on: Tue, 18 December 2012 23:03] Report message to a moderator
|
|
|
|
Powered by
FUDForum. Page generated in 0.08684 seconds