Results 1 to 2 of 2

Thread: Q. about a Hibernate article and TransactionProxyFactoryBean

  1. #1
    Join Date
    Jun 2005
    Posts
    1

    Default Q. about a Hibernate article and TransactionProxyFactoryBean

    I cookbook quite a bit from Hibernate's "Data Access with the Spring Framework" article ( http://www.hibernate.org/110.html )

    Tonight I was working on adding transaction management to a service class and was about to use TransactionProxyFactoryBean when I re-read a line from that article:

    A convenient alternative way of setting up declarative transactions is TransactionProxyFactoryBean, particularly if there are no other AOP interceptors involved.
    Does the last part mean that I should not use this method if we plan to add other pointcuts to that service? I can back off to the previous method described, which just adds one more bean, but I haven't found anything in your docs or code that would explain why they made that statement.

    Thanks,
    -Jeff

  2. #2
    Join Date
    Aug 2004
    Location
    Melbourne, Australia
    Posts
    1,104

    Default

    A convenient alternative way of setting up declarative transactions is TransactionProxyFactoryBean, particularly if there are no other AOP interceptors
    You can add other interceptors easily enough with postInterceptors and preInterceptors properties

    Code:
        <bean id="txTemplate" abstract="true" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
    		<property name="transactionManager"><ref local="transactionManager"/></property>
    		<property name="proxyTargetClass"><value>true</value></property>
    		<property name="transactionAttributes">
    			<props>
    				<prop key="save*">PROPAGATION_REQUIRED</prop>
    				<prop key="delete*">PROPAGATION_REQUIRED</prop>
    				<prop key="find*">PROPAGATION_REQUIRED,readOnly</prop>
    				<prop key="login*">PROPAGATION_REQUIRED,readOnly</prop>
    			</props>
    		</property>
    		<property name="preInterceptors">
    			<list>
    				<ref local="securityInterceptor"/>
    			</list>
    		</property>
    		<property name="postInterceptors">
    			<list>
    				<ref local="logInterceptor"/>
    			</list>
    		</property>
    	</bean>
    Does the last part mean that I should not use this method if we plan to add other pointcuts to that service?
    Do you mean other pointcuts or other interceptors?

Similar Threads

  1. Martin Fowler's article & big problems
    By quartz in forum Meta
    Replies: 11
    Last Post: Aug 3rd, 2006, 10:50 AM
  2. Hibernate Interceptor and getHibernateTemplate??
    By vaibhavkhattri in forum Data
    Replies: 1
    Last Post: Aug 12th, 2005, 03:18 AM
  3. Replies: 0
    Last Post: Jun 6th, 2005, 06:22 AM
  4. JSR-168 + JSF + Spring + Hibernate
    By bostone in forum Architecture
    Replies: 3
    Last Post: Nov 9th, 2004, 12:50 PM
  5. Replies: 8
    Last Post: Sep 23rd, 2004, 01:12 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •