1 | public void testUpdateFailureWithParamChecking() {↵ | | 1 | public void testDeleteWithExceptionChecking() {↵
|
2 | Session s = openSession();↵ | | 2 | Session s = openSession();↵
|
3 | s.beginTransaction();↵ | | 3 | s.beginTransaction();↵
|
4 | ParamCheckingEntity e = new ParamCheckingEntity();↵ | | 4 | ExceptionCheckingEntity e = new ExceptionCheckingEntity();↵
|
5 | e.setId( new Long( 1 ) );↵ | | 5 | e.setId( new Long( 1 ) );↵
|
6 | e.setName( "dummy" );↵ | | 6 | e.setName( "dummy" );↵
|
7 | s.update( e );↵ | | 7 | s.delete( e );↵
|
8 | try {↵ | | 8 | try {↵
|
9 | s.flush();↵ | | 9 | s.flush();↵
|
10 | fail( "expection flush failure!" );↵ | | 10 | fail( "expection flush failure!" );↵
|
11 | }↵ | | 11 | }↵
|
12 | catch( HibernateException ex ) {↵ | | 12 | catch( JDBCException ex ) {↵
|
13 | // these should specifically be HibernateExceptions...↵ | | 13 | // these should specifically be JDBCExceptions...↵
|
14 | }↵ | | 14 | }↵
|
15 | s.clear();↵ | | 15 | s.clear();↵
|
16 | s.getTransaction().commit();↵ | | 16 | s.getTransaction().commit();↵
|
17 | s.close();↵ | | 17 | s.close();↵
|
18 | | | 18 |
|