entityManager.getTransaction().begin(); UnitOfWork unitOfWork = (UnitOfWork)((JpaEntityManager)entityManager.getDelegate()).getActiveSession(); unitOfWork.beginEarlyTransaction(); Accessor accessor = unitOfWork.getAccessor(); accessor.incrementCallCount(unitOfWork.getParent()); accessor.decrementCallCount(); java.sql.Connection connection = accessor.getConnection(); ... entityManager.getTransaction().commit();
public CompassSession getCurrentCompassSession(Session session) { if (session.isUnitOfWork()) { Session parentSession = ((UnitOfWork) session).getParent(); CompassSessionHolder sessionHolder = sessionsHolders.get(parentSession); if (sessionHolder != null) { return sessionHolder.session; } else { return beginCompassSessionAndTx(parentSession).session; } } else { CompassSessionHolder sessionHolder = sessionsHolders.get(session); if (sessionHolder != null) { return sessionHolder.session; } else { return beginCompassSessionAndTx(session).session; } } }
UnitOfWork uow = sharedSession.getActiveUnitOfWork(); if (uow != null) { return uow.getParent();
UnitOfWork uow = sharedSession.getActiveUnitOfWork(); if (uow != null) { return uow.getParent();
UnitOfWork uow = sharedSession.getActiveUnitOfWork(); if (uow != null) { return uow.getParent();