I am using Hibernate 3.
If I execute "session.update" and the update is not successful (e.g. value too large), the exception is not thrown immediately.
For example,
System.out.println ("pass 1");
session.update(dataBean) ;
System.out.println ("pass 2");
session.getTransaction().commit();
System.out.println ("pass 3");
I find if session.update(dataBean) fails, "pass 1" and "pass 2" are printed but "pass 3" is not printed. That meams Hibernate will not throw exception until I execute "commit". Can I force it to throw immediately (i.e. only "pass 1" will be printed) ?
Thanks in advance.
|