posted 14 years ago
In your example the client is not shown, method b() may have the same transaction as method a()
if they are called from the client with the same transactional context.
If for method b() the container has started a new transaction, the entity manager has a new persistence context, which you query in line 12 with contains(myEntity). You didn't code a find() or something else to populate the persistence context.