MyObject myObject = repositoryHibernateImpl.getMyObjectFromDatabase();
//transaction is finished, and no, there is not an option to reopen it
ThirdPartyUtility.doStu
Let's say you have a field, in the getter you could:
MyField getMyField() {
if (Hibernate.isInitialized(myField)) {
return myField;
}
return null;
}
From the javadoc of org.hibernate.Hibernate:
public static boolean isInitialized(Object proxy): check if the proxy or persistent collection is initialized.