java - How to set springframework @Transactional with AspectJ -
I want to use spring-facets to make my methods workable, but use spring aop (spring aop) Just fine without doing it: & lt; Tx: annotation-driven / & gt;) I'm using Maven to manage my project.
Is there any way to do this compile time for weaving on my project classes "they are transactional". I was trying to use this plugin: but without any good results
Please help.
I understood that the Maven plugin works fine, but the problem was with my spring config: I :
& lt; Bean id = "transactionManager" class = "org.springframework.orm.jpa.JpaTransactionManager" & gt; & Lt; Property Name = "entityManagerFactory" Reference = "entityManagerFactory" /> & Lt; / Bean & gt; & Lt; Tx: annotation-driven transaction-manager = "transaction manager" />
What do I need:
& lt; Bean id = "transaction manager" category = "org.springframework.orm.hibernate3.HibernateTransactionManager" & gt; & Lt; Property Name = "sessionFactory" ref = "SessionFire" / & gt; & Lt; / Bean & gt; & Lt; Bean class = "org.springframework.transaction.aspectj.AnnotationTransactionAspect" factory-method = "aspect" and "gt; & lt; property name =" transactionManager "reference =" transaction manager "/> gt; & lt; / bean
Now it works fine and the performance of my @transaction management has been improved and everything I am doing.
Here's my Maven Assassin Plugin Config:
& lt; plugins & gt; & gt; Group & gt; org.codehaus.mojo & lt; / group & gt; ArtifactId & gt; AspectJ-Maven -Plugin & lt; / artifactId> & lt; Version & gt; 1.3 & lt; / s Karan & gt; Configurations & gt; & gt; AttributesLibraries & gt; & gt; AspectLibrary & gt; & lt; Group & gt; org.springframework & lt; / group & gt; & lt; artifactId & gt; Spring-facets & lt; / artifactId & gt; / aspectLibrary & gt; & gt; / aspectLibraries & gt; & lt; source & gt; 1.5 & lt; / source & gt; & lt; showWeaveInfo & gt; True & lt; / showWeaveInfo & gt; & lt; / configuration & gt; & lt; hang & gt; & lt; execution & gt; & Lt; Goals & gt; & Lt; Goal & gt; Collection & lt; / Target & gt; & Lt; / Targets & gt; & Lt; / Execution & gt; & Lt; / Hanging & gt; & Lt; / Plugin & gt;
Hope it helps someone.
Comments
Post a Comment