Examples of DbPersistenceService


Examples of org.jbpm.persistence.db.DbPersistenceService

    }

    private void startNewTxn(final JbpmJsfContextImpl jbpmJsfContext) {
        if (jbpmJsfContext.hasJbpmContext()) {
            final JbpmContext jbpmContext = jbpmJsfContext.getJbpmContext();
            DbPersistenceService dbPersistenceService = (DbPersistenceService) jbpmContext.getServices().getPersistenceService();
            log.fine("Committing transaction");
            dbPersistenceService.endTransaction();
            dbPersistenceService.beginTransaction();
        }
    }
View Full Code Here

Examples of org.jbpm.persistence.db.DbPersistenceService

    if (jbpmContext != null) {
      Services services = jbpmContext.getServices();
      if (services != null) {
        Service service = services.getPersistenceService();
        if (service instanceof DbPersistenceService) {
          DbPersistenceService persistenceService = (DbPersistenceService) service;
          return persistenceService.isTransactionActive() || persistenceService.getTransaction() == null;
        }
      }
    }

    // no transaction detected, probably running in memory only
View Full Code Here

Examples of org.jbpm.persistence.db.DbPersistenceService

   */
  public void setSessionFactory(SessionFactory sessionFactory)
  {
    PersistenceService persistenceService = getPersistenceService();
    if (persistenceService instanceof DbPersistenceService) {
      DbPersistenceService dbPersistenceService = (DbPersistenceService) persistenceService;
      dbPersistenceService.setSessionFactory(sessionFactory);
    }
  }
View Full Code Here

Examples of org.jbpm.persistence.db.DbPersistenceService

   */
  public void setSession(Session session)
  {
    PersistenceService persistenceService = getPersistenceService();
    if (persistenceService instanceof DbPersistenceService) {
      DbPersistenceService dbPersistenceService = (DbPersistenceService) persistenceService;
      dbPersistenceService.setSession(session);
    }
  }
View Full Code Here

Examples of org.jbpm.persistence.db.DbPersistenceService

   */
  public void setConnection(Connection connection)
  {
    PersistenceService persistenceService = getPersistenceService();
    if (persistenceService instanceof DbPersistenceService) {
      DbPersistenceService dbPersistenceService = (DbPersistenceService) persistenceService;
      dbPersistenceService.setConnection(connection);
    }
  }
View Full Code Here

Examples of org.jbpm.persistence.db.DbPersistenceService

   * gets the hibernate session factory from the default configured persistence
   * service. 
   * @throws ClassCastException if another persistence service is configured then the default.
   */
  public SessionFactory getSessionFactory() {
    DbPersistenceService persistenceService = (DbPersistenceService) getPersistenceService();
    if (persistenceService==null) return null;
    return persistenceService.getSessionFactory();
  }
View Full Code Here

Examples of org.jbpm.persistence.db.DbPersistenceService

   * gets the hibernate session from the default configured persistence
   * service. 
   * @throws ClassCastException if another persistence service is configured then the default.
   */
  public Session getSession() {
    DbPersistenceService persistenceService = (DbPersistenceService) getPersistenceService();
    if (persistenceService==null) return null;
    return persistenceService.getSession();
  }
View Full Code Here

Examples of org.jbpm.persistence.db.DbPersistenceService

   * service, preventing the creation of a session from the configured
   * session factory (if there is one configured).
   * @throws ClassCastException if another persistence service is configured then the default.
   */
  public void setSession(Session session) {
    DbPersistenceService persistenceService = (DbPersistenceService) getPersistenceService();
    if (persistenceService==null) return;
    persistenceService.setSession(session);
  }
View Full Code Here

Examples of org.jbpm.persistence.db.DbPersistenceService

  /**
   * gets the jdbc connection from the default configured persistence service.
   * @throws ClassCastException if another persistence service is configured then the default.
   */
  public Connection getConnection() {
    DbPersistenceService persistenceService = (DbPersistenceService) getPersistenceService();
    if (persistenceService==null) return null;
    return persistenceService.getConnection();
  }
View Full Code Here

Examples of org.jbpm.persistence.db.DbPersistenceService

   * allows users to provide a jdbc connection to be used when the hibernate
   * session is created.
   * @throws ClassCastException if another persistence service is configured then the default.
   */
  public void setConnection(Connection connection) {
    DbPersistenceService persistenceService = (DbPersistenceService) getPersistenceService();
    if (persistenceService==null) return;
    persistenceService.setConnection(connection);
  }
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.