try {
Serializable id = session.getIdentifier(entity);
if (id != null)
session.buildLockRequest(LockOptions.NONE).lock(entity);
} catch (TransientObjectException e) {
// Entity is a new object, nothing to reattach
}
No comments:
Post a Comment