1 Reply Latest reply on Dec 18, 2012 11:20 AM by kevinthackray

    JtaTransactionManager does not support custom isolation levels by default

    kevinthackray

      Hi,

       

      I am trying to use the build-in Fuse transaction manager Aries GeronimoPlatformTransactionManager.

      In my application, I am using a 2 differents datasources (both oracle.jdbc.pool.OracleDataSource). 1 is linked to a org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean (for my app code) and 1 is given to SpringBatch.

       

      In my application bundles, I get a reference to the transaction manager like the following:

       

      <osgi:reference id="my.transactionManager"

      interface="org.springframework.transaction.PlatformTransactionManager" />;

       

      And I am getting this:

      org.springframework.transaction.InvalidIsolationLevelException: JtaTransactionManager does not support custom isolation levels by default - switch 'allowCustomIsolationLevels' to 'true'

      at org.springframework.transaction.jta.JtaTransactionManager.applyIsolationLevel(JtaTransactionManager.java:884)92:org.springframework.transaction:3.0.5.RELEASE

      at org.springframework.transaction.jta.JtaTransactionManager.doJtaBegin(JtaTransactionManager.java:860)92:org.springframework.transaction:3.0.5.RELEASE

      at org.springframework.transaction.jta.JtaTransactionManager.doBegin(JtaTransactionManager.java:820)92:org.springframework.transaction:3.0.5.RELEASE

      at org.springframework.transaction.support.AbstractPlatformTransactionManager.getTransaction(AbstractPlatformTransactionManager.java:371)92:org.springframework.transaction:3.0.5.RELEASE

      at org.apache.aries.transaction.GeronimoPlatformTransactionManager.getTransaction(GeronimoPlatformTransactionManager.java:72)

      at sun.reflect.GeneratedMethodAccessor108.invoke(Unknown Source)

       

      FYI, I am not specifing any IsolationLevel.

      Any idea how I can either:

      • Setup the JtaTransactionManager and set allowCustomIsolationLevels: the exposed service is a GeronimoPlatformTransactionManager and not the JtaTransactionManager. How can I get an easy ref to it?

      • Fix somehow the fact that I must do something wrong with the IsolationLevel.

       

      Regards,

       

      Kevin.

       

      Edited by: kevinthackray on Dec 17, 2012 2:53 PM

        • 1. Re: JtaTransactionManager does not support custom isolation levels by default
          kevinthackray

          I found out how to pleased my Jta transaction manager in order not to use any custom isolation levels. Spring batch JobRepositoryFactoryBean sets some custom isolation levels by default, so I add this:

           

          <bean id="my.jobRepository" class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean">

          <property name="databaseType" value="${jdbc.database.batch.type}" />

          <property name="transactionManager" ref="my.transactionManager" />

          <property name="dataSource" ref="my.dataSource" />

          <property name="isolationLevelForCreate" value="ISOLATION_DEFAULT"/>

          </bean>

           

          It fixes my problem, however, I still wonder:

          • Impact on transaction management for spring batch

          • How can I configure the underlying JtaTransactionManager

           

          Edited by: kevinthackray on Dec 18, 2012 4:19 PM