Package org.hibernate.action

Examples of org.hibernate.action.AfterTransactionCompletionProcess


    public void afterTransactionCompletion(boolean success) {
      final int size = processes.size();
      for ( int i = 0; i < size; i++ ) {
        try {
          AfterTransactionCompletionProcess process = processes.get( i );
          process.doAfterTransactionCompletion( success, session );
        }
        catch ( CacheException ce ) {
          log.error( "could not release a cache lock", ce );
          // continue loop
        }
View Full Code Here


    public void afterTransactionCompletion(boolean success) {
      final int size = processes.size();
      for ( int i = 0; i < size; i++ ) {
        try {
          AfterTransactionCompletionProcess process = ( AfterTransactionCompletionProcess ) processes.get( i );
          process.doAfterTransactionCompletion( success, session );
        }
        catch ( CacheException ce ) {
          log.error( "could not release a cache lock", ce );
          // continue loop
        }
View Full Code Here

            // No worries about registering a transaction twice - a transaction is single thread
            auditProcess = new AuditProcess(revisionInfoGenerator);
            auditProcesses.put(transaction, auditProcess);

            session.getActionQueue().registerProcess(auditProcess);
            session.getActionQueue().registerProcess(new AfterTransactionCompletionProcess() {
                public void doAfterTransactionCompletion(boolean success, SessionImplementor session) {
                    auditProcesses.remove(transaction);
                }
            });
        }
View Full Code Here

     * regardless of commit success.
     * @param session Active Hibernate session.
     * @param data Audit data that shall be evicted (e.g. revision data or entity snapshot)
     */
    public void scheduleAuditDataRemoval(final Session session, final Object data) {
        ((EventSource) session).getActionQueue().registerProcess(new AfterTransactionCompletionProcess() {
            public void doAfterTransactionCompletion(boolean success, SessionImplementor session) {
                if (!session.isClosed()) {
                    ((Session) session).evict(data);
                }
            }
View Full Code Here

    public void afterTransactionCompletion(boolean success) {
      final int size = processes.size();
      for ( int i = 0; i < size; i++ ) {
        try {
          AfterTransactionCompletionProcess process = processes.get( i );
          process.doAfterTransactionCompletion( success, session );
        }
        catch ( CacheException ce ) {
                    LOG.unableToReleaseCacheLock(ce);
          // continue loop
        }
View Full Code Here

    public void afterTransactionCompletion(boolean success) {
      final int size = processes.size();
      for ( int i = 0; i < size; i++ ) {
        try {
          AfterTransactionCompletionProcess process = ( AfterTransactionCompletionProcess ) processes.get( i );
          process.doAfterTransactionCompletion( success, session );
        }
        catch ( CacheException ce ) {
          log.error( "could not release a cache lock", ce );
          // continue loop
        }
View Full Code Here

            auditProcess = new AuditProcess(revisionInfoGenerator, session);
            auditProcesses.put(transaction, auditProcess);

            session.getActionQueue().registerProcess(auditProcess);

            session.getActionQueue().registerProcess(new AfterTransactionCompletionProcess() {
                public void doAfterTransactionCompletion(boolean success, SessionImplementor session) {
                    auditProcesses.remove(transaction);
                }
            });
        }
View Full Code Here

             * written. However, Synchronization-s do propagate exceptions, so they can be safely used.
             */
            session.getActionQueue().registerProcess(auditProcess);
            session.getTransaction().registerSynchronization(auditProcess);

            session.getActionQueue().registerProcess(new AfterTransactionCompletionProcess() {
                public void doAfterTransactionCompletion(boolean success, SessionImplementor session) {
                    auditProcesses.remove(transaction);
                }
            });
        }
View Full Code Here

     * regardless of commit success.
     * @param session Active Hibernate session.
     * @param data Audit data that shall be evicted (e.g. revision data or entity snapshot)
     */
    public void scheduleAuditDataRemoval(final Session session, final Object data) {
        ((EventSource) session).getActionQueue().registerProcess(new AfterTransactionCompletionProcess() {
            public void doAfterTransactionCompletion(boolean success, SessionImplementor session) {
                ((Session) session).evict(data);
            }
        });
    }
View Full Code Here

            auditProcess = new AuditProcess(revisionInfoGenerator, session);
            auditProcesses.put(transaction, auditProcess);

            session.getActionQueue().registerProcess(auditProcess);

            session.getActionQueue().registerProcess(new AfterTransactionCompletionProcess() {
                public void doAfterTransactionCompletion(boolean success, SessionImplementor session) {
                    auditProcesses.remove(transaction);
                }
            });
        }
View Full Code Here

TOP

Related Classes of org.hibernate.action.AfterTransactionCompletionProcess

Copyright © 2018 www.massapicom. 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.