Thanks, Alen. I just changed like you said and it worked like a charm :)
On Thursday, May 3, 2012 6:53:34 PM UTC-3, Alen Vrečko wrote: > > I found guice-persist to have broken txn semantics. I didn't had time > to investigate. I went back with using warp-persist which works great! > > I'd build warp-persist from source > http://code.google.com/p/warp-persist/source/checkout. > It has a well documented txn semantics and they work as explained. > http://www.wideplay.com/guicewebextensions2 > > In any case I suspect you do @Inject EntityManager but what you should > really do is @Inject Provider<EntityManager> this is a major > difference. > > Cheers > Alen > > On May 3, 2:53 pm, Carlos Alexandro Becker <[email protected]> wrote: > > I have an app managed by maven with two modules: one for persistence, > and > > another for the webapp itself (gwt). > > > > My tests in persistence module works like a charm, but, in webapp, when > I > > execute the same method multiple times I got a > java.lang.IllegalStateException: > > Attempting to execute an operation on a closed EntityManager.. > > > > I use guice-persist to inject the entity manager into my DAOs, and all > my > > DAO methods have the @Transactional annotation. > > > > In my webapp, I put a: public class ScuvServletModule extends > ServletModule > > { > > > > @Override > > protected void configureServlets() { > > super.configureServlets(); > > install(MyPersistenceAPI.getModule()); // return my module and > install it > > filter("/*").through(PersistFilter.class); > > /// another bindings... > > } > > > > } > > > > If I remove the PersistFilter, it wotks, but randomly throws a > Transaction > > Closed exception or something like that. > > > > Any help? -- 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/-/iDzf83jPtyoJ. 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.
