Hi,

I have small API server application based on Jersey, Hibernate/JPA and 
Guice, running in Tomcat. I want to use guice-persist extension for better 
handling EntityManager instances and transactions. Now I'm doing the whole 
work in each controller method, so each method creates EntityManager, 
starts transaction, close everything etc. The guice-persist thing looks 
pretty straightforward, but I don't know how to handle this:

I have only one persistence-unit, but application caches more 
EntityManagerFactory instances, each with its own properties. These 
properties are loaded from configuration on runtime. I cannot configure 
GuiceServletContextListener with module 
JpaPersistModule("unit").properties(myProperties) because myProperties are 
based on request parameters -- my application supports multi-tenancy and 
tenants has data in several similar databases.

How can I use guice-persist with this scenario?

Thanks, 
Martin Schayna

-- 
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/-/VkEMbqLBVsgJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to