Announcement Announcement Module
Collapse
No announcement yet.
Transaction Interceptors Trouble Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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?

    Comment


    • #3
      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 -->

      Comment


      • #4
        can any of you help me please

        Comment

        Working...
        X