-
Aug 16th, 2009, 03:35 PM
#1
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
-
Aug 17th, 2009, 04:51 AM
#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
-
Aug 17th, 2009, 08:07 AM
#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
-
Aug 17th, 2009, 07:20 PM
#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
-
Aug 18th, 2009, 08:50 AM
#5
thanks again....I'll have a look at it at some point.....it's funny that it calls it "mapping" metadata
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules