161162163164165166167168169170171
s.merge(user); tx.commit(); } catch (Exception e) { if (tx!=null) tx.rollback(); throw e; } finally { s.close(); }
187188189190191192193194195196197
item.setDescription(description); tx.commit(); } catch (Exception e) { if (tx!=null) tx.rollback(); throw e; } finally { s.close(); }
222223224225226227228229230231232
); tx.commit(); } catch (Exception e) { if (tx!=null) tx.rollback(); throw e; } finally { s.close(); }
265266267268269270271272273274275
System.out.println(); tx.commit(); } catch (Exception e) { if (tx!=null) tx.rollback(); throw e; } finally { s.close(); }
8586878889909192939495
fail("expected stale write to fail"); } catch (Throwable expected) { // expected behavior here if (txn != null) { try { txn.rollback(); } catch (Throwable ignore) { } } } finally { if (s != null && s.isOpen()) {
7172737475767778798081
assertTrue( "Environment.MESSAGE_INTERPOLATOR_CLASS does not work", e.getInvalidValues()[0].getMessage().startsWith( "prefix_") ); } finally { if ( tx != null ) tx.rollback(); s.close(); } a = new Address(); Address.blacklistedZipCode = "3232";
103104105106107108109110111112113
assertTrue( "Environment.MESSAGE_INTERPOLATOR_CLASS does not work", e.getInvalidValues()[0].getMessage().startsWith( "prefix_") ); } finally { if ( tx != null ) tx.rollback(); s.close(); } s = openSession(); tx = s.beginTransaction();
157158159160161162163164165166167
} catch (InvalidStateException e) { assertEquals( 2, e.getInvalidValues().length ); } finally { tx.rollback(); s.close(); } } public void testIdClass() throws Exception {
179180181182183184185186187188189
} catch (InvalidStateException e) { assertEquals( 1, e.getInvalidValues().length ); } finally { tx.rollback(); s.close(); } } protected void configure(Configuration cfg) {
2829303132333435363738
assertEquals( 0, ccValid.getInvalidValues( cc ).length ); Session s = openSession(); Transaction tx = s.beginTransaction(); s.persist( cc ); s.flush(); tx.rollback(); s.close(); } protected Class[] getMappings() { return new Class[]{