Package org.hibernate

Examples of org.hibernate.Transaction.rollback()


    Transaction t = s.beginTransaction();

    int count = s.createQuery( "update PettingZoo set name = name" ).executeUpdate();
    assertEquals( "Incorrect discrim subclass update count", 1, count );

    t.rollback();
    t = s.beginTransaction();

    count = s.createQuery( "update PettingZoo pz set pz.name = pz.name where pz.id = :id" )
        .setLong( "id", data.pettingZoo.getId().longValue() )
        .executeUpdate();
View Full Code Here


    count = s.createQuery( "update PettingZoo pz set pz.name = pz.name where pz.id = :id" )
        .setLong( "id", data.pettingZoo.getId().longValue() )
        .executeUpdate();
    assertEquals( "Incorrect discrim subclass update count", 1, count );

    t.rollback();
    t = s.beginTransaction();

    count = s.createQuery( "update Zoo as z set z.name = z.name" ).executeUpdate();
    assertEquals( "Incorrect discrim subclass update count", 2, count );
View Full Code Here

    t = s.beginTransaction();

    count = s.createQuery( "update Zoo as z set z.name = z.name" ).executeUpdate();
    assertEquals( "Incorrect discrim subclass update count", 2, count );

    t.rollback();
    t = s.beginTransaction();

    // TODO : not so sure this should be allowed.  Seems to me that if they specify an alias,
    // property-refs should be required to be qualified.
    count = s.createQuery( "update Zoo as z set name = name where id = :id" )
View Full Code Here

    try {
      transaction.begin();
      this.hibernateTemplate.save(t);
      transaction.commit();
    } catch (final HibernateException e) {
      transaction.rollback();
      LOGGER.error(e);
      throw new DataNotStoredException(
          "Payer was not stored for some reason", e);
    }
  }
View Full Code Here

            transaction.commit();
           
        } catch(HibernateException he) {
            System.out.println(he.getMessage());
            if(transaction != null) {
                transaction.rollback();
            }
           
            throw new DaoException(he);
           
        } finally {
View Full Code Here

            transaction.commit();
           
        } catch(HibernateException he) {
           
            if(transaction != null) {
                transaction.rollback();
            }
           
            throw new DaoException(he);
           
        } finally {
View Full Code Here

            transaction.commit();
           
        } catch(HibernateException he) {
           
            if(transaction != null) {
                transaction.rollback();
            }
           
            throw new DaoException(he);
           
        } finally {
View Full Code Here

            transaction.commit();
           
        } catch(HibernateException he) {
           
            if(transaction != null) {
                transaction.rollback();
            }
           
            throw new DaoException(he);
           
        } finally {
View Full Code Here

            transaction.commit();
           
        } catch(HibernateException he) {
           
            if(transaction != null) {
                transaction.rollback();
            }
           
            throw new DaoException(he);
           
        } finally {
View Full Code Here

            transaction.commit();
           
        } catch(HibernateException he) {
           
            if(transaction != null) {
                transaction.rollback();
            }
           
            throw new DaoException(he);
           
        } finally {
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.