开发者

Can i use spring exception translation without using spring-managed-transaction?

I'm developing with JPA 2 and Spring 3.

I'm using the @Repository for my Dao classes hoping that i could make use of the Spring exception translation.

But the problem is, i'm not using the spring managed transaction (no @Transactional, no definition of transactionManager in my spring config file), but a custom transaction handling for my JPA apps.

Is it still possible somehow to make use of the translation from my custom transaction manager ? The implementation of this custom transaction manager is still using the EntityManagerFactory and EntityManager from JPA.

Please share your thoughts.

Thank you开发者_Go百科 !


If you use @Repository annotation, you will get Spring translated exception, whether you use spring transaction manager or not :

Can i use spring exception translation without using spring-managed-transaction?

But of course, you won't get the Spring exceptions which would be thrown by the Spring transaction manager itself.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜