I’m using Hibernate as ORM and I have my DAOs annotated with @Repository.
I have configured AOP advice this way.
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="save*" propagation="REQUIRED" />
<tx:method name="edit*" propagation="REQUIRED" />
<tx:method name="*" read-only="true" />
</tx:attributes>
</tx:advice>
They work fine it’s just that if any sql exception happens in these methods they’re not caught and hence not printed! I’m guessing because transactions commit after executing the method but I’m not sure.
How do I handle it?
Take a look at this similar post. It suggests extending SimpleMappingExceptionResolver