Uploaded image for project: 'JBoss ESB'
  1. JBoss ESB
  2. JBESB-1050

DBMessageStoreImpl: Cannot change transaction isolation level in the middle of a transaction. Postgres

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Rejected
    • Affects Version/s: None
    • Fix Version/s: 4.2.1
    • Component/s: Message Store
    • Labels:
      None
    • Workaround Description:
      Hide

      We have currently simply commented out this line in the redeliver method:
      con = mgr.getConnection();
      con.setAutoCommit(false);
      //con.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);

      Show
      We have currently simply commented out this line in the redeliver method: con = mgr.getConnection(); con.setAutoCommit(false); //con.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);

      Description

      We have been seeing this DEBUG level message when we have more then one message with the same classification in the message store:

      2007-09-14 10:08:05,376 DEBUG [org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl]
      Deadlocks may occur under normal processing
      2007-09-14 10:08:05,376 DEBUG [org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl]
      Cannot change transaction isolation level in the middle of a transaction.
      org.postgresql.util.PSQLException: Cannot change transaction isolation level in the middle of a tran
      saction.
      at org.postgresql.jdbc2.AbstractJdbc2Connection.setTransactionIsolation(AbstractJdbc2Connection.
      java:733)
      at org.jboss.resource.adapter.jdbc.BaseWrapperManagedConnection.setJdbcTransactionIsolation(Base
      WrapperManagedConnection.java:534)
      at org.jboss.resource.adapter.jdbc.WrappedConnection.setTransactionIsolation(WrappedConnection.j
      ava:390)
      at org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl.redeliver(DBMessageStoreI
      mpl.java:318)
      at org.jboss.soa.esb.actions.MessageRedeliverer.process(MessageRedeliverer.java:74)
      at org.jboss.soa.esb.listeners.message.ActionProcessingPipeline.process(ActionProcessingPipeline
      .java:265)
      at org.jboss.soa.esb.listeners.ScheduleListener.onSchedule(ScheduleListener.java:108)
      at org.jboss.soa.esb.schedule.ScheduleProvider$ESBScheduledJob.execute(ScheduleProvider.java:212
      )
      at org.quartz.core.JobRunShell.run(JobRunShell.java:202)

      The code lines above might not directly match the ones in the current trunk as I've made a few modifications locally to support a simple redelivery of messages described in this dev forum thread: http://www.jboss.com/index.html?module=bb&op=viewtopic&t=116023&start=10

      This following line of code in the redeliver method is causing this message:
      con = mgr.getConnection();
      con.setAutoCommit(false);
      con.setTransactionIsolation(Connection.TRANSACTION_READ_UNCOMMITTED);

      The redeliver method is called by MessageRedeliverer action. The first message uid is successful but the second call will log the above message.

      But I do think that this will be an issue when using postgres.

      Some info about postgres and its transaction isolation levels:
      Quote:
      "In postgres, you can use all four possible transaction isolation levels. Internally, there are only two distinct isolation levels, which
      correspond to the levels Read Committed and Serializable. When you select the level Read
      Uncommitted you actually get Read Committed, and when you select Repeatable Read you really get Serializable, so the actual isolation
      level may be stricter than what you select."

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                kurtstam Kurt Stam
                Reporter:
                beve Daniel Bevenius
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: