Transactions and the AOP

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

Transactions and the AOP

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"
    <property name="userDAO"><ref local="userDAO"/></property>

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"
    <property name="transactionManager">
        <ref local="transactionManager"/>
    <property name="target">
        <ref local="userManagerTarget"/>
    <property name="transactionAttributes">
            <prop key="save*">PROPAGATION_REQUIRED</prop>
            <prop key="remove*">PROPAGATION_REQUIRED</prop>
            <prop key="*">PROPAGATION_REQUIRED,readOnly</prop>

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