I am wondering if it is possible to make a JPA implementation throw an exception when a managed BO is modified outside a transaction of the managing entity manager. For example:
BO someBO = new BO();
entityManager.getTransaction().begin();
entityManager.persist(someBO);
entityManager.getTransaction().commit();
someBO.setSomeField(someValue);
Is there a possible configuration of a JPA implementation that results in an exception in the last line?
We are migrating from JDO 1.0, where such an exception would be thrown in the last line when not explicitly configured otherwise.