Announcement Announcement Module
Collapse
No announcement yet.
TransactionProxyFactoryBean + HibernateInterceptor Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • TransactionProxyFactoryBean + HibernateInterceptor

    im testing spring 1.2 RC1 + Hibernate 3

    because with hibernate 3 everything is lazy="true" (i know i cant set lazy="false" when i need it ... but i dont want) i need to keep a session open in the business objects

    Im using something like this

    <bean id="hibernateInterceptor" class="org.springframework.orm.hibernate3.Hibernat eInterceptor">
    <property name="sessionFactory">
    <ref bean="VEPSF"/>
    </property>
    </bean>

    <bean id="RecaudadorBO" class="org.springframework.transaction.interceptor .TransactionProxyFactoryBean">
    <property name="transactionManager">
    <ref bean="VEPTM" />
    </property>
    <property name="target">
    <ref bean="RecaudadorBOTarget" />
    </property>
    <property name="transactionAttributes">
    <props>
    <prop key="agregar*">PROPAGATION_REQUIRED</prop>
    <prop key="modificar*">PROPAGATION_REQUIRED</prop>
    <prop key="borrar*">PROPAGATION_REQUIRED</prop>
    <prop key="obtener*">PROPAGATION_REQUIRED</prop>
    </props>
    </property>
    <property name="postInterceptors">
    <list>
    <ref local="hibernateInterceptor" />
    </list>
    </property>
    </bean>

    <bean id="RecaudadorBOTarget" class="cr.go.ice.vep.bo.pojo.RecaudadorBOImpl">
    <property name="recaudadorDAO">
    <ref bean="RecaudadorDAO" />
    </property>
    <property name="usuarioSDDAO">
    <ref bean="UsuarioSDDAO" />
    </property>
    </bean>

    but it dont work ... i dont know how to use HibernateInterceptor with TransactionProxyFactoryBean

    i have tried preInterceptors and postInterceptors but does not work

    Any idea ??? what im doing worg ??

    Thanks
    Ignacio

  • #2
    because with hibernate 3 everything is lazy="true" (i know i cant set lazy="false" when i need it ... but i dont want) i need to keep a session open in the business objects
    But this should happen naturally if you delimit transactions around business methods (a best practice)...

    Comment

    Working...
    X