@Transactional Parameters

89 views
Skip to first unread message

Owen Berger

unread,
Mar 3, 2012, 7:01:32 PM3/3/12
to google-guice
Is there a full list of parameters for the guice-persist version of
@Transactional anywhere? I have been googling for hours and can't
find the answer.

Also, has anyone used a different version or extended their own with
success? I have been thinking about using the org.mybatis.guice
version of @Transactional, but don't know if that would break
anything, and I don't like importing all the new dependencies for just
one class. Thanks for the help.

scl

unread,
Mar 4, 2012, 3:48:15 AM3/4/12
to google-guice
I used guice in a project with 2 databases. in order to be able to
have a transaction only on one database I wrote my own
@TransactionalDB1 and @TransactionalDB2 annotation.
Then I copied the class JpaLocalTxnInterceptor and adapted it to be
able to handle two different databases.
Finally I bind the the modified transaction interceptor to my new
annotations.

Worked out like a charm.
Hope this answer helps even if I didn't usemybatis.

Owen Berger

unread,
Mar 4, 2012, 4:13:30 PM3/4/12
to google...@googlegroups.com
It does help and gives me some Ideas.  I was thinking about rolling my own, but I just wanted to know if there was an existing solution out there without writing my own hacky code.  Thanks.

p.s. I wasn't going to use myBatis, just their @Transactional tag, but I had some weird build errors with Maven when trying that, so am back to the regular old guice-persist @Transactional.


--
You received this message because you are subscribed to the Google Groups "google-guice" group.
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.


Vicente J. Ruiz Jurado

unread,
Mar 6, 2012, 8:34:37 PM3/6/12
to google...@googlegroups.com
Hi there,

I'm trying to use two databases in my project too. I was trying with:
http://code.google.com/p/google-guice/wiki/GuicePersistMultiModules
until I found your more complete snippet (great):
https://groups.google.com/d/topic/google-guice/2VK-bdsnjZc/discussion

Now I'm in a point where I can access to both databases (thanks) but, cannot persist nothing. I was trying to create several custom persist objects and annotations without luck.

Can you share this part also? Do you have a public repo?

TIA,

Vicente
Reply all
Reply to author
Forward
0 new messages