Package org.hibernate

Examples of org.hibernate.Transaction.rollback()


        items[i].setId(-1);
      }
    } catch (Exception e) {
      if (tx != null) {
        try {
          tx.rollback();
        } catch (HibernateException e1) {
          // We can do nothing here.
        }
      }
View Full Code Here


      tx.commit();
      item.setId(-1);
    } catch (Exception e) {
      if (tx != null) {
        try {
          tx.rollback();
        } catch (HibernateException e1) {
          // We can do nothing here.
        }
      }
View Full Code Here

      tx.commit();
    } catch (Exception e) {
      if (tx != null) {
        try {
          tx.rollback();
        } catch (HibernateException e1) {
          // We can do nothing here.
        }
      }
View Full Code Here

      long start = System.currentTimeMillis();
      JasperFillManager.fillReportToFile(reportFile.getAbsolutePath(), params);
      System.err.println("Report : " + reportFile + ". Filling time : " + (System.currentTimeMillis() - start));
    }
   
    transaction.rollback();
    session.close();
  }
 
 
  /**
 
View Full Code Here

  public void closeOpenedSessions() {
    for ( Session session : openedSessions ) {
      if ( session.isOpen() ) {
        Transaction transaction = session.getTransaction();
        if ( transaction != null && transaction.isActive() ) {
          transaction.rollback();
        }
        session.close();
      }
    }
  }
View Full Code Here

            LOGGER.debug("add %s to user table", displayName);
            session.save(newUser);
            transaction.commit();
        } catch (HibernateException e) {
            if (transaction != null) {
                transaction.rollback();
            }
            throw new LumifyException("HibernateException while adding user", e);
        }

        userListenerUtil.fireNewUserAddedEvent(newUser);
View Full Code Here

            ((SqlUser) user).setPassword(salt, passwordHash);
            session.update(user);
            transaction.commit();
        } catch (HibernateException e) {
            if (transaction != null) {
                transaction.rollback();
            }
            throw new LumifyException("HibernateException while setting password", e);
        }
    }
View Full Code Here

            session.update(user);
            transaction.commit();
        } catch (HibernateException e) {
            if (transaction != null) {
                transaction.rollback();
            }
            throw new LumifyException("HibernateException while recording login", e);
        }
    }
View Full Code Here

            sqlUser.setCurrentWorkspace(workspaces.get(0));
            session.merge(sqlUser);
            transaction.commit();
        } catch (HibernateException e) {
            if (transaction != null) {
                transaction.rollback();
            }
            throw new LumifyException("HibernateException while setting current workspace", e);
        }
        return sqlUser;
    }
View Full Code Here

            session.update(sqlUser);
            transaction.commit();
        } catch (HibernateException e) {
            if (transaction != null) {
                transaction.rollback();
            }
            throw new LumifyException("HibernateException while setting preferences", e);
        }
    }
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.