EntityManager#contains(Object) Rolls Back the Transaction

A note for posterity: if you call EntityManager#contains(Object) on an object that is not known to that EntityManager, it will throw an IllegalArgumentException. When it does so, it irrevocably rolls the transaction back.

Instead, use something like this:

Author: Laird Nelson

Devoted husband and father; working on Helidon at the intersection of Java, Jakarta EE, architecture, Kubernetes and microservices at Oracle; open source guy; Hammond B3 player and Bainbridge Islander.