Hi, I'm having the same issue as: http://groups.google.com/group/google-guice/browse_thread/thread/a984cd0c90e8414e/47501069e845aac2?lnk=gst&q=persistence+unit+multiple#47501069e845aac2
I did expose the unitofwork and persistenceservice and deployed the app with only one private persistence module and thus one persistence unit. This worked. When I added the second private module, which was configured the same except it had my other persistence unit bound to it, I got the same exception. Is there any guidance you could provide as to solving this issue. The current approach in guice for one persistence unit works quite well and is very easy to configure. Thx On Jul 8, 8:57 pm, dhanji <[email protected]> wrote: > Do you mean it complains about UnitOfWork not being bound? > > In that case you need to expose the binding. Multiple modules are a > bit experimental at the moment, and no one has really developed around > them afaik. > > the now-defunct warp-persist project has had support for multiple > modules for awhile though. > > Dhanji. > > On Jul 8, 5:09 am, jdestef <[email protected]> wrote: > > > > > > > > > Hi, > > > I'd like to use a second persistence unit in a web application. I have > > a persistence module that currently looks something like this: > > > public MyServletModule extends ServletModule { > > ......... > > ........ > > > // Jpa > > install(new JpaPersistModule("unitName")); > > filter("/*").through(PersistFilter.class); > > > } > > > The documentation suggests installing multiple units using the > > PrivateModule class. It also says indicates that filter("/ > > *").through(PersistFilter.class); can be called multiple times for > > each private JpaModule. I tried the following but get binding errors > > for PersistService and UnitOfWork: > > > public MyServletModule extends ServletModule { > > ......... > > ........ > > > // Jpa > > PrivateModule priv = new PrivateModule { > > install(new JpaPersistModule("unitName")); > > filter("/*").through(PersistFilter.class); > > > } > > > install(priv); > > > } > > > Has anyone successfully implemented this feature. I've seem only a > > couple of posts on the forum about the subject. It would be great if > > there was an example of this in the tests for the persist extension. > > > Any help appreciated. > > > Thx -- You received this message because you are subscribed to the Google Groups "google-guice" group. 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.
