Package org.hibernate

Examples of org.hibernate.Transaction.rollback()


            + executionCount.toString() + " , deteccion evento: "
            + event.getName());
      } else {
        logger.debug("Se cancela el proceso de deteccion para el evento: "
            + event.getName());
        transaction.rollback();
        if ((event != null) && (event.getDelete() != null)) {
          timer.cancel();
        }
        BackgroundEventController.getInstance().getActiveProcesses()
            .remove(event.getId());
View Full Code Here


          }
        } catch (ConstraintViolationException e) {
          logger.error(Tools.getStackTrace(e));
         
          if ((transaction != null) && (transaction.isActive())) {
            transaction.rollback();
          }
         
          Map map = new HashMap();
          map.put(ParamsConst.ERROR, "ConstraintViolationException");
         
View Full Code Here

        } catch (Throwable e) {
         
          logger.error(Tools.getStackTrace(e));
         
          if ((transaction != null) && (transaction.isActive())) {
            transaction.rollback();
          }
        }
      }
    } catch (Exception e) {
      logger.error(Tools.getStackTrace(e));
View Full Code Here

        }
      }
    } catch (Exception e) {
      logger.error(Tools.getStackTrace(e));
      if ((transaction != null) && (transaction.isActive())) {
        transaction.rollback();
      }
      throw e;
    }

    logger.info("Fin ejecucion " + this.getClass().getName());
View Full Code Here

 
      getSession().save(comentario);   
      transaction.commit();
   
    } catch (Exception e){
      transaction.rollback();
      logger.error(Tools.getStackTrace(e));
      throw new ServiceExecuteException();
    }
    return null;
  }
View Full Code Here

            return true;

        } catch (HibernateException he) {
            if (transaction != null) {
                try {
                   transaction.rollback();
                } catch (HibernateException re) {
                    // ignore
                }
            }
            throw he;
View Full Code Here

    Transaction tx = threadTransaction.get();
    try {
      threadTransaction.set(null);
      if (tx != null && !tx.wasCommitted() && !tx.wasRolledBack()) {
        log.debug("Tyring to rollback database transaction of this thread.");
        tx.rollback();
      }
    } catch (HibernateException ex) {
      throw new InfrastructureException(ex);
    } finally {
      closeSession();
View Full Code Here

    tr.commit();
    flag = true;
    }catch(Exception e)
    {
      e.printStackTrace();
      tr.rollback();
    }
    return flag;
  }
 
 
View Full Code Here

      tx.commit();
      flag = true;
    }catch(Exception e)
    {
      e.printStackTrace();
      tx.rollback();
   
    return flag;
   
  }
 
View Full Code Here

      tx.commit();
      return true;
    }catch(Exception e)
    {
      e.printStackTrace();
      tx.rollback();
      return false;
   
   
   
  }
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.