facebook

Glassfish Peristance Problems

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #272003 Reply

    amattas
    Member

    See last post of bug, regarding code for ejb3 database reversed engineered

    https://glassfish.dev.java.net/issues/show_bug.cgi?id=3235

    #272040 Reply

    Loyal Water
    Member

    I didnt get what you are trying to say. Are you reporting a bug? Can you please paste the text that you were refering to over here ?

    #272048 Reply

    amattas
    Member

    The code the EJB3 Reverse engineer generated triggered a bug in glass fish.

    2. Now about the bug in the user’s test case:
    This test case is using the PU name “cis” twice, viz: 1)in the EJBs where it is
    injecting a PersistenceContext, 2)in EntityManagerHelper as shown below:

    private static final EntityManagerFactory emf; ^M

    static {
    emf = Persistence.createEntityManagerFactory(“cis”);
    }

    This emf is never closed, and this is exactly the kind of application described
    earlier in this comment. A look at the test source code reveals that emf is
    never used, so it can be safely removed without affecting the functionality.

    The fix they suggested is as follows

    Your EJBs are using container managed persistence
    context, so you don’t have to worry about opening and closing any em or emf. All
    you need to do is to fix your EntityManagerHelper.class, which is calling
    Persistence.createEMF(). Why do you need to create an emf again in this class?
    You are only using the log() method of this class in your EJBs. The static
    variable emf and threadLocal are not used anywhere. You can remove them and you
    will not hit the bug.

Viewing 3 posts - 1 through 3 (of 3 total)
Reply To: Glassfish Peristance Problems

You must be logged in to post in the forum log in