ANN: guice-jpa - Support of multiple datasources and JTA

489 views
Skip to first unread message

scl

unread,
Jan 11, 2013, 4:13:36 PM1/11/13
to google...@googlegroups.com
After configuring guice-persist for the 3rd project with multiple data sources I decided to write my own guice persistence extension.
guice-jpa is based on guice-persist and everybody familiar with guice-persist should have no trouble to use guice-jpa.

It supports:
 - multiple persistence units
 - application manged and container managed persistence units
 - RESOURCE_LOCAL and JTA transactions.

It is currently in use in a project running on JBoss using
 - 2 JTA controlled data sources
 - 1 RESOURCE_LOCAL datasource

Have a look at https://github.com/sclassen/guice-jpa/wiki

Stephan Classen

unread,
Jan 13, 2013, 2:41:44 PM1/13/13
to google...@googlegroups.com
Cool if you give it a try.

Can you tell me what version of tomcat and what databases (H2, Oracle, MySQL, ...) you are using?
I haven't used plain tomcat before but this sounds like a good time to get some hands on experience.


On 01/12/2013 07:45 PM, Lucio Crusca wrote:


Have a look at https://github.com/sclassen/ stop tomcat, guice-jpa/wiki

I'm a guice-persist newbie (a guice newbie in general to be honest) and I need two datasources in my webapp. After following this guide

http://blog.pandurangpatil.com/2012/10/mulitple-persistence-unit-with-guice.html

or, for sake of completeness, after trying those suggestions myself and then copying and pasting the code from included example, only to struggle against obsure guice exceptions, I feel like fed up enough with guice-persist (heck it complains about something in a PrivateModule I even deleted from the project, then cleaned and rebuilt all, searched for that PM .java and .class files on the filesystem, deleted them, clean&build, stop tomcat, reboot, and so on, and it still pretends that that no-more-existing PM is doing something wrong).
I'm willing to try guice-jpa, because from the sample code in the wiki it seems simpler than guice-persist, but I fail to understand how to integrate it in a simple wicket webapp in tomcat (I don't know what parts are JBoss specific in that guide).
Can you provide a minimal tomcat + guice-jpa + 2datasources example please?
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-guice/-/UjITNm4B7zEJ.
To post to this group, send email to google...@googlegroups.com.
To unsubscribe from this group, send email to google-guice...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.

Reply all
Reply to author
Forward
0 new messages