Package javax.transaction

Examples of javax.transaction.Synchronization.beforeCompletion()


    BlobByteArrayType type = new BlobByteArrayType(lobHandler, tm);
    assertEquals(content, type.nullSafeGet(rs, new String[] {"column"}, null));
    type.nullSafeSet(ps, content, 1);
    Synchronization synch = transaction.getSynchronization();
    assertNotNull(synch);
    synch.beforeCompletion();
    synch.afterCompletion(Status.STATUS_COMMITTED);
    verify(lobCreator).setBlobAsBytes(ps, 1, content);
  }

  @Test
View Full Code Here


    assertEquals("content", type.nullSafeGet(rs, new String[] {"column"}, null));
    type.nullSafeSet(ps, "content", 1);
    Synchronization synch = transaction.getSynchronization();
    assertNotNull(synch);
    synch.beforeCompletion();
    synch.afterCompletion(Status.STATUS_COMMITTED);
    verify(lobCreator).setBlobAsBytes(ps, 1, baos.toByteArray());
  }

  @Test
View Full Code Here

      Synchronization synchronization = flushSynch.get( session );
      if ( synchronization != null ) {
        //first cleanup
        flushSynch.remove( session );
        log.debug( "flush event causing index update out of transaction" );
        synchronization.beforeCompletion();
        synchronization.afterCompletion( Status.STATUS_COMMITTED );
      }
    }
  }
View Full Code Here

      Synchronization synchronization = flushSynch.get( session );
      if ( synchronization != null ) {
        //first cleanup
        flushSynch.remove( session );
        log.debug( "flush event causing index update out of transaction" );
        synchronization.beforeCompletion();
        synchronization.afterCompletion( Status.STATUS_COMMITTED );
      }
    }
  }
View Full Code Here

      Synchronization synchronization = flushSynch.get( session );
      if ( synchronization != null ) {
        //first cleanup
        flushSynch.remove( session );
        log.debug( "flush event causing index update out of transaction" );
        synchronization.beforeCompletion();
        synchronization.afterCompletion( Status.STATUS_COMMITTED );
      }
    }
  }
View Full Code Here

        // now call beforeCompletion for all pmSyncs
        for ( int i=0; i<pmSyncs.size(); i++ ) {
            Synchronization sync = (Synchronization)pmSyncs.elementAt(i);
            try {
                sync.beforeCompletion();
            } catch ( RuntimeException ex ) {
                logAndRollbackTransaction(ex);
                throw ex;
            } catch ( Exception ex ) {
                logAndRollbackTransaction(ex);
View Full Code Here

                    return;
                }
                synch = (Synchronization) syncList.get(i++);
            }
            try {
                synch.beforeCompletion();
            } catch (Exception e) {
                log.warn("Unexpected exception from beforeCompletion; transaction will roll back", e);
                synchronized (this) {
                    status = Status.STATUS_MARKED_ROLLBACK;
                }
View Full Code Here

        // Regular syncs first then the interposed syncs
        Enumeration e = syncs.elements();
        while (e.hasMoreElements()) {
            Synchronization sync = (Synchronization) e.nextElement();
            try {
                sync.beforeCompletion();
            } catch (RuntimeException rex) {
                try {
                    state.setRollbackOnly();
                } catch (Exception ex1) {
        _logger.log(Level.WARNING,
View Full Code Here

        }
        Enumeration e1 = interposedSyncs.elements();
        while (e1.hasMoreElements()) {
            Synchronization sync = (Synchronization) e1.nextElement();
            try {
                sync.beforeCompletion();
            } catch (RuntimeException rex) {
                try {
                    state.setRollbackOnly();
                } catch (Exception ex1) {
        _logger.log(Level.WARNING,
View Full Code Here

   public void beforeCompletion()
   {
      if (this.getDatabaseManager() instanceof Synchronization)
      {
         Synchronization dbManager = (Synchronization) this.getDatabaseManager();
         dbManager.beforeCompletion();
      }

   }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.