@Scott: But wouldn't you agree that the exception that the user/developer wants to see is the one that is thrown in the try block? Therefore this exception should be thrown or be at least a part of the thrown exception (either as cause or by using supressed exc.). And yes, em.flush() works and brings the correct exception. But I'm using Spring Data JPA that wraps all the entity manager stuff away. Well I could still get hold of the entity manager and do a flush but this would break my design somehow.
|