How do I change the transaction settings for Spring Data repositories globally? -


i'm using spring data application repositories.

interface myuserrepository extends jparepository<myuser, long> { … } 

spring data adding transactional repositories default propagation.required if i'm not mistaken. how can set propagation.mandatory repositories in aop. don't want set annotation every repository.

idea behind forbid using repositories out of transactional scope used through services. i'm using aop other services not working correctly repositories proxied.

you can create custom repository base interface , annotate settings need:

@norepositorybean @transactional(propagation = propagation.mandatory) public interface baserepository<t, id extends serializable> extends pagingandsortingrepository<t, id> {  } 

now let of application repositories extend base repository interface , you'll go.


Comments

Popular posts from this blog

matlab - "Contour not rendered for non-finite ZData" -

delphi - Indy UDP Read Contents of Adata -

javascript - Any ideas when Firefox is likely to implement lengthAdjust and textLength? -