Examples of StoreInternalException


Examples of org.openxri.exceptions.StoreInternalException

      this.initSessionFactory();
    } catch (Exception ex) {

      log.error(ex);
      throw new StoreInternalException(ex, "Cannot initialize Hibernate");
    }

    log.trace("Done.");
  }
View Full Code Here

Examples of org.openxri.exceptions.StoreInternalException

    this.initSessionFactory();

    if (this.sessionFactory != null && ! this.sessionFactory.isClosed()) return(this.sessionFactory);

    throw new StoreInternalException("Database not available.");
  }
View Full Code Here

Examples of org.openxri.exceptions.StoreInternalException

      session.getTransaction().commit();
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot list root subsegments.");
    }

    // build result list

    SubSegment[] result = new ArrayList<SubSegment> (subSegments).toArray(new SubSegment[subSegments.size()]);
View Full Code Here

Examples of org.openxri.exceptions.StoreInternalException

      session.getTransaction().commit();
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    // run XRD through the CREATE pipeline

    XRD newXRD;

    try {

      if (createPipeline != null) {

        newXRD = createPipeline.execute(this, xrd, null, null, null, authority, true);
      } else {

        newXRD = xrd;
      }
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot execute pipeline.");
    }

    // start database session

    session = this.getSessionFactory().getCurrentSession();

    // set XRD

    try {

      session.beginTransaction();

      reattach(session, authority);

      authority.setXrd(newXRD);

      session.update(authority);
      session.flush();
      session.getTransaction().commit();
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    // done

    log.trace("Done.");
View Full Code Here

Examples of org.openxri.exceptions.StoreInternalException

      throw(ex);
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    // run XRD through the CREATE pipeline

    XRD newXRD;

    try {

      if (createPipeline != null) {

        newXRD = createPipeline.execute(this, xrd, null, null, null, authority, true);
      } else {

        newXRD = xrd;
      }
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot execute pipeline.");
    }

    // start database session

    session = this.getSessionFactory().getCurrentSession();

    // set XRD

    try {

      session.beginTransaction();

      reattach(session, authority);

      authority.setXrd(newXRD);

      session.update(authority);
      session.flush();
      session.getTransaction().commit();
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    // start database session

    session = this.getSessionFactory().getCurrentSession();

    // create root subsegment

    DbSubSegment subSegment;

    try {

      session.beginTransaction();

      reattach(session, authority);

      subSegment = new DbSubSegment();
      subSegment.setName(name);
      subSegment.setAuthority(authority);

      session.save(subSegment);
      session.flush();
      session.refresh(subSegment);
      session.getTransaction().commit();
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    // done

    log.trace("Done.");
View Full Code Here

Examples of org.openxri.exceptions.StoreInternalException

      throw(ex);
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    log.trace("Done.");
  }
View Full Code Here

Examples of org.openxri.exceptions.StoreInternalException

      session.getTransaction().commit();
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    log.trace("Done.");
  }
View Full Code Here

Examples of org.openxri.exceptions.StoreInternalException

      throw(ex);
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    // run XRD through the CREATE pipeline

    XRD newXRD;

    try {

      if (createPipeline != null) {

        newXRD = createPipeline.execute(this, xrd, null, parentAuthority, subSegmentName, authority, true);
      } else {

        newXRD = xrd;
      }
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot execute pipeline.");
    }

    // start database session

    session = this.getSessionFactory().getCurrentSession();

    // set XRD

    try {

      session.beginTransaction();

      reattach(session, authority);

      authority.setXrd(newXRD);

      session.update(authority);
      session.flush();
      session.getTransaction().commit();
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    // start database session

    session = this.getSessionFactory().getCurrentSession();

    // create subsegment with this authority

    DbSubSegment subSegment;

    try {

      session.beginTransaction();

      reattach(session, parentAuthority);
      reattach(session, authority);

      subSegment = new DbSubSegment();
      subSegment.setParent((DbAuthorityparentAuthority);
      subSegment.setName(subSegmentName);
      subSegment.setAuthority(authority);

      ((DbAuthority) parentAuthority).getChildren().add(subSegment);
      authority.getSubSegments().add(subSegment);

      session.save(subSegment);
      session.flush();
      session.refresh(subSegment);
      session.getTransaction().commit();
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    // done

    log.trace("Done.");
View Full Code Here

Examples of org.openxri.exceptions.StoreInternalException

      throw ex;
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    // done

    log.trace("Done.");
View Full Code Here

Examples of org.openxri.exceptions.StoreInternalException

      session.getTransaction().commit();
    } catch (Exception ex) {

      log.error(ex);
      if (session.isOpen() && session.getTransaction().isActive()) session.getTransaction().rollback();
      throw new StoreInternalException(ex, "Cannot access database.");
    }

    log.trace("Done.");
  }
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.