There are some DataAccessExceptions that I would like to catch ... such as DataIntegrityViolation (really just the duplicate key exception) . All of my transactions start and end at the service level as most of the examples in the spring documentation demonstrate. Could someone please clarify if I can catch these exceptions in the service layer ? I was under the impression that these exceptions would only be available to the caller of the serivce layer. If I wanted to make these available to the service layer then I would have to set eager flushing on the hibernate template. Everytime I try and catch a data integrity violation it is only available to the caller of the service layer. If I set eager flushing in the template it seems to work ... I can then catch the exception inside the service method .. as oppose to the caller of the service method. I would like to catch these exceptions in the service layer and rethrow them as some service level exception .. because these errors are recoverable.
Thanks again
Serge
