Announcement Announcement Module
Collapse
No announcement yet.
eclipseLink doesn't like transient entity manager Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • eclipseLink doesn't like transient entity manager

    I am using Roo M2....set up a project and installed a jpa like so:

    install jpa -provider ECLIPSELINK -dataBase MYSQL

    then, ran "mvn test" and it seems that EclipeLink doesnt like the transient on:

    @javax.persistence.PersistenceContext
    transient javax.persistence.EntityManager Airport.entityManager;

    so, I changed them all (in xxx_Roo_Entity.aj) to public (Using a text editor)...and, EclipseLink seems to be happier. Not withstanding other errors, which I will investigate.

    Then, I restart Roo on the project and Roo, of course, changes them back to transient.
    Is there a way to force the use of a qualifier, other than "transient" on this annotation?

    thanks
    Edwin

  • #2
    Edwin,

    The transient field issue is known to cause problems with EclipseLink. I reported this back in February. You can vote on the ticket if you wish: https://bugs.eclipse.org/bugs/show_bug.cgi?id=264962

    -Stefan

    Comment


    • #3
      possible solution

      Thank you for the response.

      I have experimented and found that by putting the annotation and field definiton in the domain class allows an override. Placing :

      @javax.persistence.PersistenceContext
      public javax.persistence.EntityManager entityManager;

      in the domain class causes Roo to use this definition.

      Is this the preferred way of doing this?

      Thanks

      Comment


      • #4
        Well, omitting the transient keyword for the EntityManager would cause this field to be serialized - something that is definitely undesirable .

        However, as luck would have it, the EclipseLink bug seems to have been addressed over night https://bugs.eclipse.org/bugs/show_bug.cgi?id=264962 . If you find the time, it would be nice if you could test it and see if it works now with the fixed version. Maybe EclipseLink releases nightly snapshots?

        -Stefan

        Comment


        • #5
          thanks again....I'll have a look at it at some point.....it's funny that it calls it "mapping" metadata

          Comment

          Working...
          X