Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Virgo » Transaction Management with Virgo(Managing transactions from other osgi bundles)
Transaction Management with Virgo [message #990579] Thu, 13 December 2012 09:36 Go to next message
Erik Vande Velde is currently offline Erik Vande VeldeFriend
Messages: 82
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] Wed, 19 December 2012 04:03 Go to previous messageGo to next message
Dmitry Sklyut is currently offline Dmitry SklyutFriend
Messages: 279
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: Wed, 19 December 2012 04:03]

Report message to a moderator

Re: Transaction Management with Virgo [message #997182 is a reply to message #991427] Fri, 04 January 2013 09:59 Go to previous message
Erik Vande Velde is currently offline Erik Vande VeldeFriend
Messages: 82
Registered: September 2012
Member
Hi Dmitry. Thanks for your answer. We came to the same solution as the one you suggested by looking a bit further on the internet But in the end we decided to forget about OSGi (for the time being?), as explained here: http://www.eclipse.org/forums/index.php/m/997180/#msg_997180
Previous Topic:Problem installing hibernate library bundles
Next Topic:Why we stopped using Virgo/OSGi in our project
Goto Forum:
  


Current Time: Thu Apr 25 14:50:27 GMT 2024

Powered by FUDForum. Page generated in 0.04073 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top