The documentation for EntityManager.persist() says it will Make an instance managed and persistent.
It is persisting the entity to the database, but when I call the EntityManager.contains() method to check if the entity that I just persisted is managed it returns false.
I just want to know why does this happen? Maybe are there somethings that I was not able to do or something I overlooked?
Suggestions would be appreciated 😀
That’s really strange. According the the Sun EJB3 spec:
Are you calling
containsin the same transaction?