public void postMergeUnitOfWorkChangeSet(SessionEvent event) {
   UnitOfWorkChangeSet uowChangeSet =
       (UnitOfWorkChangeSet) event.getProperty("UnitOfWorkChangeSet");
   if (uowChangeSet.hasChanges()) {
     lock(LOCKED_BY_SOURCE_LISTENER);
   }
 }
예제 #2
0
 public void preReleaseConnection(SessionEvent event) {
   DatasourceAccessor accessor = (DatasourceAccessor) event.getResult();
   try {
     if (accessor.getLogin() == null) {
       throw new RuntimeException("released accessor.getLogin() == null");
     }
     if (accessor.getDatasourceConnection() == null) {
       throw new RuntimeException(
           "AcquireReleaseListener: released accessor.getDatasourceConnection() == null");
     }
   } catch (RuntimeException ex) {
     ex.printStackTrace();
     throw ex;
   }
 }
 /**
  * PUBLIC: This event is raised before the execution of every query against the session. The
  * event contains the query to be executed.
  */
 public void preExecuteQuery(SessionEvent event) {
   test.non_txn_read = event.getQuery().getAccessor();
   event.getQuery().getAccessor().closeConnection();
 }
 /**
  * PUBLIC: This event is raised on the unit of work after creation/acquiring. This will be raised
  * on nest units of work.
  */
 public void postAcquireUnitOfWork(SessionEvent event) {
   event.getSession().setProperty(KEY, new ReferenceResolver());
 }