lundi 26 janvier 2015

Hibernate deatched entity passed to persist

I'm getting this PersistanceObjectException being thrown during one of my integration tests.


The the test it self runs fine when run on its own, but not as part as a test suite. So I added DirtiesContext to all the integration tests, however this for some reason has had no affect.


I've confirmed that the entity I'm trying to persist DOES NOT exist, when I try to persist it. However, the error only occurs when a previous test (in a different class) does the same persist.


If this was a case of the entity staying persisted from one case to the next, why isn't DirtiesContext would fix this, and my check to see if the entity is already persisted would be true.


The persist operation is a simple entityManager.persist(entity). Nothing complex or fancy.


Any ideas? I'm really stumped on this one.


Aucun commentaire:

Enregistrer un commentaire