Results 1 to 4 of 4

Thread: Transaction Interceptors Trouble

  1. #1
    Join Date
    Nov 2004
    Posts
    7

    Default Transaction Interceptors Trouble

    This is my architecture, I'm using hibernate and spring aop, i have a transaction manager: org.springframework.orm.hibernate.HibernateTransac tionManager and a transaction interceptor:
    org.springframework.transaction.interceptor.Transa ctionInterceptor
    i hava one method and it has PROPAGATION_REQUIRED as transactionAttributeSource.

    Here is my problem.

    I'm loading an object, it has a collection, and the object in that collection has a set too, anyhow, while I'm downloading the object after the method is called the interception performs a commit, while it's flushing the transacition, it's spitting some select queries, but after that it stars to delete the rows from the collection and then it tries to insert them right away.

    Is there any form that i can fix that deleting and inserting of rows at loading objects?

    I tried setting the method as PROPAGATION_NEVER but it didn't work it started to delete the rows after loading the object!!

  2. #2
    Join Date
    Aug 2004
    Location
    Montréal, Canada
    Posts
    845

    Default

    You can use PROPAGATION_REQUIRED,readOnly to fix updating the data after it has been read.
    Could you provide more information about the configuration used?
    Omar Irbouh

    Spring Modules Team
    http://irbouh.blogspot.com/

  3. #3
    Join Date
    Nov 2004
    Posts
    7

    Default

    well this is the configuration for my method

    operaciones.certificados.orm.CertificadoDAO.mostra r=PROPAGATION_NEVER I also have tried
    ISOLATION_READ_COMMITTED
    PROPAGATION_NEVER

    the configuration is like this
    <!-- session factory -->
    <bean id="cerSessionFactory"
    class="org.springframework.orm.hibernate.LocalSess ionFactoryBean">
    <property name="mappingResources">
    <!-- this one goes on and on with all the hibernate config -->

    <!-- transaction support -->
    <bean id="cerTransactionManager" class="org.springframework.orm.hibernate.Hibernate TransactionManager">
    <property name="sessionFactory">
    <ref bean="cerSessionFactory"/>
    </property>
    </bean>
    <bean id="cerTransactionInterceptor" class="org.springframework.transaction.interceptor .TransactionInterceptor">
    <property name="transactionManager">
    <ref bean="cerTransactionManager"/>
    </property>
    <property name="transactionAttributeSource">
    <value>
    operaciones.certificados.orm.CertificadoDAO.mostra r=PROPAGATION_NEVER
    </value>
    </property>
    </bean>

    <!-- CertificadoDAO -->
    <bean id="certificadoDAOTarget" class="operaciones.certificados.orm.impl.Certifica doDAOImpl">
    <property name="sessionFactory">
    <ref bean="cerSessionFactory"/>
    </property>
    </bean>
    <bean id="certificadoDAO" class="org.springframework.aop.framework.ProxyFact oryBean">
    <property name="proxyInterfaces">
    <value>operaciones.certificados.orm.CertificadoDAO </value>
    </property>
    <property name="interceptorNames">
    <value>cerTransactionInterceptor,certificadoDAOTar get</value>
    </property>
    </bean>
    <!-- CertificadoVencidoDAO -->

  4. #4
    Join Date
    Nov 2004
    Posts
    7

    Default

    can any of you help me please

Similar Threads

  1. Unit testing with JOTM and JtaTransactionManager
    By lalle in forum Architecture
    Replies: 1
    Last Post: Oct 15th, 2005, 09:05 AM
  2. Replies: 0
    Last Post: Jun 6th, 2005, 06:22 AM
  3. Replies: 2
    Last Post: Feb 16th, 2005, 04:25 PM
  4. Replies: 3
    Last Post: Nov 19th, 2004, 07:16 PM
  5. Transaction pb Hibernate/MySQL
    By syluser in forum Data
    Replies: 2
    Last Post: Aug 28th, 2004, 02:40 PM

Posting Permissions

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