Package com.dotmarketing.exception

Examples of com.dotmarketing.exception.DotHibernateException


    try{
      try {
        local = HibernateUtil.startLocalTransactionIfNeeded();
      } catch (DotDataException e1) {
        Logger.error(TemplateFactoryImpl.class,e1.getMessage(),e1);
        throw new DotHibernateException("Unable to start a local transaction " + e1.getMessage(), e1);
      }
      HibernateUtil.delete("from template_containers in class com.dotmarketing.beans.TemplateContainers where template_id = '" + template.getIdentifier() + "'");
      for(Container container:containerIdentifiers){
        TemplateContainers templateContainer = new  TemplateContainers();
        templateContainer.setTemplateId(template.getIdentifier());
View Full Code Here


      mappings = cfg.createMappings();
      sessionFactory = cfg.buildSessionFactory();
      dialect = cfg.getProperty("hibernate.dialect");

    }catch (Exception e) {
      throw new DotHibernateException("Unable to build Session Factory ", e);
    }
  }
View Full Code Here

      }
      sessionHolder.set(session);
      session.setFlushMode(FlushMode.NEVER);
      return session;
    }catch (Exception e) {
      throw new DotHibernateException("Unable to get Hibernate Session ", e);
    }
  }
View Full Code Here

              if(!commitListeners.get().containsKey(tag))
                  commitListeners.get().put(tag,listener);
          }
      }
      catch(Exception ex) {
          throw new DotHibernateException(ex.getMessage(),ex);
      }
  }
View Full Code Here

                listener.run();
            else
                rollbackListeners.get().add(listener);
        }
        catch(Exception ex) {
            throw new DotHibernateException(ex.getMessage(),ex);
        }
    }
View Full Code Here

          session.close();
          session = null;
          sessionHolder.set(null);
      }
    }catch (Exception e) {
      throw new DotHibernateException("Unable to close Hibernate Session ", e);
    }
    finally {
        commitListeners.get().clear();
        rollbackListeners.get().clear();
    }
View Full Code Here

      getSession().connection().setAutoCommit(false);
      rollbackListeners.get().clear();
      commitListeners.get().clear();
      Logger.debug(HibernateUtil.class, "Starting Transaction!");
    }catch (Exception e) {
      throw new DotHibernateException("Unable to set AutoCommit to false on Hibernate Session ", e);
    }
  }
View Full Code Here

  public static void flush()  throws DotHibernateException{
    try{
      Session session = getSession();
      session.flush();
    }catch (Exception e) {
      throw new DotHibernateException("Unable to flush Hibernate Session ", e);
    }
  }
View Full Code Here

      conn = getSession().connection();
      if(!conn.getAutoCommit())
        return conn.setSavepoint();
      return null;
    } catch (HibernateException e) {
      throw new DotHibernateException(e.getMessage(), e);
    } catch (SQLException e) {
      throw new DotHibernateException(e.getMessage(), e);
    }
    }
View Full Code Here

  public static void rollbackSavepoint(Savepoint savepoint) throws DotHibernateException {

    try {
      getSession().connection().rollback(savepoint);
    } catch (HibernateException e) {
      throw new DotHibernateException(e.getMessage(), e);
    } catch (SQLException e) {
      throw new DotHibernateException(e.getMessage(), e);
    }

  }
View Full Code Here

TOP

Related Classes of com.dotmarketing.exception.DotHibernateException

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.