Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7898515
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:27:14+00:00 2026-06-03T08:27:14+00:00

I have an app managed by maven with two modules: one for persistence, and

  • 0

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?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T08:27:15+00:00Added an answer on June 3, 2026 at 8:27 am

    I found the problem. It is the PersistFilter. Aparently, its a Singleton, my DAOs are singletons too, but the EntityManager isnt.

    So, now I inject a Provider<EntityManager> instead EntityManager, and it works just like a charm.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an iphone app with 2 managed object contexts. One of my contexts
We have a managed app, that uses an assembly. That assembly uses some unmanaged
I have a managed class library (say mylib.dll) and a 3rd party managed app
I have managed to create a simple app which deletes (bypassing the recycle bin)
Hi i have managed to open .xls files form mail app by adding document
I have an app which is a UITabBarController, I have defined two subviews Both
We have an app in the appstore that works without any issues on iPhone
I have one console app that is doing some lengthy syncing to an ftp
I have an app that relies on several managed libraries. These managed libraries in
I have a Cocoa app with an NSOutlineView managed by an NSTreeController . In

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.