Transactions and the AOP

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Transactions and the AOP

Saeid
This post was updated on .
Hi Friends!
Recently, I've been Reviewing e-book "Spring Live by Matt Raible" since 2 day ago. that was a really Asset for me. However, I saw a minimal difference compared to the spring's new version that I wanted to share with you !

1) Preface

in somewhere (ch-02 ,P.37 ,from free PDF) after definition of the userManager bean :

<bean id="userManager"
    class="org.appfuse.service.UserManagerImpl">
    <property name="userDAO"><ref local="userDAO"/></property>
</bean> 


saying such:

"The only problem with this is you’re not leveraging Spring’s AOP and, specifically, declarative transactions" so  change the “userManager” bean to use a TransactionProxyFactoryBean class:

<bean id="userManager"
    class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    <property name="transactionManager">
        <ref local="transactionManager"/>
    </property>
    <property name="target">
        <ref local="userManagerTarget"/>
    </property>
    <property name="transactionAttributes">
        <props>
            <prop key="save*">PROPAGATION_REQUIRED</prop>
            <prop key="remove*">PROPAGATION_REQUIRED</prop>
            <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>
        </props>
    </property>
</bean>


It is understandable for me as it belongs to the old versions ,but what has confused me is the new versions of Spring (or perhaps the APF.) which is oppositing with the old. Better say, it's been somehow concealed.

2) Epilogue

With this introduction I'm going to the major issue:

Consider a case I'd have to define a transaction for my Manager classes (CategoryManagerImpl ,for example).

My question is what steps I'd have to do ,in details... ?


sorry for lengthening....
thanks in advance!






with the following declaration
Loading...