private void commitTransaction(Session session, UnitOfWork uow) { if (uow.transactional()) { Transaction txn = session.getTransaction(); if (txn != null && txn.isActive()) { txn.commit(); } } }
private void configureSession(Session session, UnitOfWork uow) { session.setDefaultReadOnly(uow.readOnly()); session.setCacheMode(uow.cacheMode()); session.setFlushMode(uow.flushMode()); }
private void beginTransaction(Session session, UnitOfWork uow) { if (uow.transactional()) { session.beginTransaction(); } }