This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
I resolved the issue, my unittest is passing when i use the find instead of contains.
So that give us a new question:
Given the following scenario:
- jpa persistence with hibernate and H2 transactions configured "resource_local"
- Class A sharing a entityManagerFactory
- Class B getting a entityManager with class A factory and persisting an object Foo
if in a class C we get a entityManager with class A factory and query for Foo:
- contains return false
- find returns object foo as expected.
Can somebody explain what i'm missing to understand here?