Package org.jbpm.persistence

Examples of org.jbpm.persistence.JbpmPersistenceException


      Exception commitException = commit();
      if (commitException != null) {
        rollback();
        closeSession();
        closeConnection();
        throw new JbpmPersistenceException("transaction commit failed", commitException);
      }
    }
    else { // isRollbackOnly==true
      Exception rollbackException = rollback();
      if (rollbackException != null) {
        closeSession();
        closeConnection();
        throw new JbpmPersistenceException("transaction rollback failed", rollbackException);
      }
    }
  }
View Full Code Here


      // JBPM-1465: at this point, the transaction is already committed or rolled back
      // alternatively, the transaction is being managed externally
      // hence rolling back here is redundant and possibly dangerous
      closeSession();
      closeConnection();
      throw new JbpmPersistenceException("hibernate flush session failed", flushException);
    }

    Exception closeSessionException = closeSession();
    if (closeSessionException != null) {
      closeConnection();
      throw new JbpmPersistenceException("hibernate close session failed", closeSessionException);
    }

    Exception closeConnectionException = closeConnection();
    if (closeConnectionException != null) {
      throw new JbpmPersistenceException("hibernate close connection failed",
          closeConnectionException);
    }
  }
View Full Code Here

      getSession().save(object);
    }
    catch (Exception e) {
      // NOTE that Errors are not caught because that might halt the JVM
      // and mask the original Error.
      throw new JbpmPersistenceException("couldn't assign id to " + object, e);
    }
  }
View Full Code Here

        try {
          log.debug("rolling back hibernate transaction");
          mustSessionBeFlushed = false; // flushing updates that will be rolled back is not very clever :-)
          transaction.rollback();
        } catch (Throwable t) {
          throw new JbpmPersistenceException("couldn't rollback hibernate session", t);
        }
      } else {
        try {
          log.debug("committing hibernate transaction");
          mustSessionBeFlushed = false; // commit does a flush anyway
          transaction.commit();
        } catch (Throwable t) {
          try {
            // if the commit fails, we must do a rollback
            transaction.rollback();
          } catch (Throwable t2) {
            // if the rollback fails, we did what we could and you're in
            // deep shit :-(
            log.error("problem rolling back after failed commit", t2);
          }
          throw new JbpmPersistenceException("couldn't commit hibernate session", t);
        }
      }
    }
   
    if (mustSessionBeFlushed) {
      try {
        log.debug("flushing hibernate session");
        session.flush();
      } catch (Throwable t) {
        throw new JbpmPersistenceException("couldn't flush hibernate session", t);
      }
    }
   
    if (mustSessionBeClosed) {
      try {
        log.debug("closing hibernate session");
        session.close();
      } catch (Throwable t) {
        throw new JbpmPersistenceException("couldn't close hibernate session", t);
      }
    }

    if (mustConnectionBeClosed) {
      try {
        log.debug("closing jdbc connection");
        connection.close();
      } catch (Throwable t) {
        throw new JbpmPersistenceException("couldn't close jdbc connection", t);
      }
    }
  }
View Full Code Here

  public void assignId(Object object) {
    try {
      getSession().save(object);
    } catch (Throwable t) {
      throw new JbpmPersistenceException("couldn't assign id to "+object, t);
    }
  }
View Full Code Here

          log.debug("rolling back hibernate transaction");
          mustSessionBeFlushed = false; // flushing updates that will be rolled back is not very clever :-)
          transaction.rollback();
        } catch (Exception e) {
          // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
          throw new JbpmPersistenceException("couldn't rollback hibernate session", e);
        }
      } else {
        try {
          log.debug("committing hibernate transaction");
          mustSessionBeFlushed = false; // commit does a flush anyway
          transaction.commit();
        } catch (Exception e) {
          // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
          try {
            // if the commit fails, we must do a rollback
            transaction.rollback();
          } catch (Exception e2) {
            // if the rollback fails, we did what we could and you're in
            // deep shit :-(
            log.error("problem rolling back after failed commit", e2);
          }
          throw new JbpmPersistenceException("couldn't commit hibernate session", e);
        }
      }
    }
  }
View Full Code Here

        Exception commitException = commit();
        if (commitException!=null) {
          rollback();
          closeSession();
          closeConnection();
          throw new JbpmPersistenceException("hibernate commit failed", commitException);
        }

      } else { // isRollbackOnly==true
        Exception rollbackException = rollback();
        if (rollbackException!=null) {
          closeSession();
          closeConnection();
          throw new JbpmPersistenceException("hibernate rollback failed", rollbackException);
        }
      }
    }
   
    Exception flushException = flushSession();
    if (flushException!=null) {
      rollback();
      closeSession();
      closeConnection();
      throw new JbpmPersistenceException("hibernate flush failed", flushException);
    }

    Exception closeSessionException = closeSession();
    if (closeSessionException!=null) {
      closeConnection();
      throw new JbpmPersistenceException("hibernate close session failed", closeSessionException);
    }

    Exception closeConnectionException = closeConnection();
    if (closeConnectionException!=null) {
      throw new JbpmPersistenceException("hibernate close conenection failed", closeConnectionException);
    }
  }
View Full Code Here

  public void assignId(Object object) {
    try {
      getSession().save(object);
    } catch (Exception e) {
      // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
      throw new JbpmPersistenceException("couldn't assign id to "+object, e);
    }
  }
View Full Code Here

          log.debug("rolling back hibernate transaction " + transaction.toString());
          mustSessionBeFlushed = false; // flushing updates that will be rolled back is not very clever :-)
          transaction.rollback();
        } catch (Exception e) {
          // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
          throw new JbpmPersistenceException("couldn't rollback hibernate session", e);
        }
      } else {
        try {
          log.debug("committing hibernate transaction " + transaction.toString());
          mustSessionBeFlushed = false; // commit does a flush anyway
          transaction.commit();
        } catch (Exception e) {
          // NOTE that Error's are not caught because that might halt the JVM and mask the original Error.
          try {
            // if the commit fails, we must do a rollback
            transaction.rollback();
          } catch (Exception e2) {
            // if the rollback fails, we did what we could and you're in
            // deep shit :-(
            log.error("problem rolling back after failed commit", e2);
          }
          throw new JbpmPersistenceException("couldn't commit hibernate session", e);
        }
      }
    }
  }
View Full Code Here

        Exception commitException = commit();
        if (commitException!=null) {
          rollback();
          closeSession();
          closeConnection();
          throw new JbpmPersistenceException("hibernate commit failed", commitException);
        }

      } else { // isRollbackOnly==true
        Exception rollbackException = rollback();
        if (rollbackException!=null) {
          closeSession();
          closeConnection();
          throw new JbpmPersistenceException("hibernate rollback failed", rollbackException);
        }
      }
    }
   
    Exception flushException = flushSession();
    if (flushException!=null) {
      rollback();
      closeSession();
      closeConnection();
      throw new JbpmPersistenceException("hibernate flush failed", flushException);
    }

    Exception closeSessionException = closeSession();
    if (closeSessionException!=null) {
      closeConnection();
      throw new JbpmPersistenceException("hibernate close session failed", closeSessionException);
    }

    Exception closeConnectionException = closeConnection();
    if (closeConnectionException!=null) {
      throw new JbpmPersistenceException("hibernate close connection failed", closeConnectionException);
    }
  }
View Full Code Here

TOP

Related Classes of org.jbpm.persistence.JbpmPersistenceException

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.