Don't have time to look into your problem. But here is a general
observation. In context of 
http://code.google.com/p/google-guice/wiki/GuicePersistMultiModules

If you have a DAO or any class for that matter that works on
persistenceUnitOne with @Transactional it MUST be bound in the private
module one. Example:

Module one = ...bind(UnitOneDao.class) ...expose(UnitOneDao.class)
Module two = ...bind(UnitTwoDao.class) ...expose(UnitTwoDao.class)

now Injector = createInjector(one,two)

UnitOneDao daoOne = injector.getInstance // @Transactional works
within the "private space" of persistenceUnitOne
UnitTwoDao daoTwo = injector.getInstance // @Transactional works
within the "private space" of persistenceUnitTwo

If your business logic never needs to write to both databases in the
same "transaction" then you have no problems. Just make sure you work
with private module space and expose the things.

If on the other hand you need to have ACID semantic on both databases
at the same time you need to go with JTA provider and custom
@Transactional.

You can expose the things as

Module one
= ...bind(UnitOneDao.class) ...expose(UnitOneDao.class) 
...expose(EntityManager.class).annotatedWith(DatabaseOne.class);

then you can @Inject @DatabaseOne EntityManager

Cheers
Alen

On Mar 10, 7:37 am, "Vicente J. Ruiz Jurado" <vruiz.jur...@gmail.com>
wrote:
> No comments? It's not clear my explanation? Shall I provide more info?
>
> Anyway as a summary: How to make @Transactional work 
> with:http://code.google.com/p/google-guice/wiki/GuicePersistMultiModules?
> or even more simple, how to expose guice-persist stuff if is binded in a
> PrivateModule?
>
> I'm blocked with this issue.
>
> TIA,
>
> Vicente

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to google-guice@googlegroups.com.
To unsubscribe from this group, send email to 
google-guice+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to