Ernest Friedman-Hill wrote: You're correct that 11 22 44 is what you will see when there is no exception, and you'll see 11 33 when there's not.
Sorry, give you confusion. when Line 4 throw a StaleObjectStateException， it will give me 11 22 44. It will be same as when there is NO exception. But what I want is when there is an exception, output will be 11 33.
Ernest Friedman-Hill wrote: Perhaps StaleObjectStateException is being thrown internally, inside update(), which is printing a message and returning normally?
What do you mean "thrown internally" ?
Spring framework provides a wrapper, org.springframework.orm.hibernate3.HibernateOptimisticLockingFailureException for this runtime exception. Is this wrapper class related to this weird thing ?