4

I'm catching javax.persistence.OptimisticLockException which works great, but I'm getting the stacktrace of StaleObjectStateException in my server log. I've checked and the getCause() on OptimisticLockException returns StaleObjectStateException, but why is it printed out to server.log? It's really annoying, I'm writing a test, where two thread are modifying the same object, and one of the are throwing OptimisticLockException which is expected, but getting stacktrace of StaleObjectStateException is not what is wanted.

Thanks for your help!

1
  • are both threads updating objects ? Commented Aug 12, 2010 at 15:23

1 Answer 1

2

Looks like you've encountered #HHH-3442 (or one of it's duplicates). Update your Hibernate.

Sign up to request clarification or add additional context in comments.

1 Comment

The bug is rejected. So the only solution seems to be to disable logging for org.hibernate.event.def.AbstractFlushingEventListener.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.