// Note if a nested unit of work this will recursively start a
// transaction early on the parent also.
if (isLockQuery()) {
if ((!unitOfWork.getCommitManager().isActive()) && (!unitOfWork.wasTransactionBegunPrematurely())) {
unitOfWork.beginTransaction();
unitOfWork.setWasTransactionBegunPrematurely(true);
}
}
if (unitOfWork.isNestedUnitOfWork()) {
UnitOfWorkImpl nestedUnitOfWork = (UnitOfWorkImpl)getSession();