Transaction management in Virgo [message #1058822] |
Wed, 15 May 2013 05:17  |
Eclipse User |
|
|
|
Hello,
After searching this forum and doing some internet research and lots of trial and error, I am still stuck with the question what would be the best option to handle transactions in Virgo. I am using:
- Spring 3.1
- Hibernate 3.6.0
- PostgreSQL 9.2
- Virgo 3.6.1
- Java 7 on Ubuntu 12.10, 64bit
I currently ended up with this design:
- A configuration bundle exports JDBC and hibernate properties as a service.
- All (currently three) OSGi bundles that contain Hibernate entities import these properties as a service. Furthermore, each of these bundles sets up an own pooled datasource, session factory and transaction manager (HibernateTransactionManager).
- A am not using JTA. If an operation spans multiple transactional service calls, a "best effort" strategy handles potential errors.
I am not happy with this solution, though and wonder what is currently considered "best practice" in my scenario.
I'd prefer a solution like this:
- A central registry of persistent entities that all bundles can contribute to.
- A single pooled datasource
- A single session factory that is consumed by all multiple bundles
- A single transaction manager that is consumed by multiple bundles
Is this feasible in an OSGi environment? If so, how??
[Updated on: Tue, 21 May 2013 02:36] by Moderator
|
|
|
|
|
|
|
|
Re: Transaction management in Virgo [message #1062813 is a reply to message #1059834] |
Mon, 10 June 2013 16:27  |
Eclipse User |
|
|
|
For the sake of completeness:
Another interesting approach to modularize the Hibernate sessionfactory on theserverside.com:
www.theserverside.com/news/thread.tss?thread_id=63223
@pascal: Thanks for the links. I'll investgate the projects.
Sorry for not posting a valid URL. The forum policy prevents this.
[Updated on: Mon, 10 June 2013 16:30] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.27448 seconds