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?