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