FUSE ESB
  1. FUSE ESB
  2. ESB-821

FUSE ESB 4 Failover does not work with PostgreSQL and Oracle

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Blocker Blocker
    • Resolution: Done
    • Affects Version/s: 4.1.0.2-fuse
    • Fix Version/s: 4.2.0.0M1-fuse
    • Component/s: Core
    • Labels:
      None
    • Similar Issues:
      Show 10 results 

      Description

      If you configure FUSE ESB 4 to use a JDBC lock for failover (i.e. the following configuration) then ServiceMix will fail with the error:

      Could not obtain lock: FATAL: database "postgres;create=true" does not exist

      Configuration (in system.properties):
      [[
      servicemix.lock=true
      servicemix.lock.class=org.apache.servicemix.kernel.main.DefaultJDBCLock
      servicemix.lock.level=50
      servicemix.lock.delay=10

      servicemix.lock.jdbc.url=jdbc:postgresql://localhost/postgres
      servicemix.lock.jdbc.driver=org.postgresql.Driver
      servicemix.lock.jdbc.user=postgres
      servicemix.lock.jdbc.password=postgres

      servicemix.lock.jdbc.table=SERVICEMIX_LOCK
      servicemix.lock.jdbc.clustername=smx4
      servicemix.lock.jdbc.timeout=30
      ]]

      I've checked the Karaf code for JDBCLock, and the string ';created=true' is always being added to the jdbc URL. I suspect that this approach has only been tested with Derby? When used with PostgreSQL, the JDBC driver errantly thinks that this suffix is in fact part of the database name.

        Gliffy Diagrams

          Activity

          Hide
          Adrian Trenaman added a comment -

          With another customer, and have found that this issue also appears when connecting to Oracle JDBC. Using the following configuration:

          [[
          servicemix.lock=true
          servicemix.lock.class=org.apache.servicemix.kernel.main.DefaultJDBCLock
          servicemix.lock.level=50
          servicemix.lock.delay=10
          servicemix.lock.jdbc.url=jdbc:oracle:thin:@frodo:1521:blah
          servicemix.lock.jdbc.driver=oracle.jdbc.driver.OracleDriver
          servicemix.lock.jdbc.user=ade
          servicemix.lock.jdbc.password=eda
          servicemix.lock.jdbc.table=SERVICEMIX_LOCK
          servicemix.lock.jdbc.clustername=smx4
          servicemix.lock.jdbc.timeout=30
          ]]

          We get the following error on ServiceMix startup.

          Could not obtain lock: Listener refused the connection with the following error:
          ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
          The Connection descriptor used by the client was:
          frodo:1521:blah;create=true

          Show
          Adrian Trenaman added a comment - With another customer, and have found that this issue also appears when connecting to Oracle JDBC. Using the following configuration: [[ servicemix.lock=true servicemix.lock.class=org.apache.servicemix.kernel.main.DefaultJDBCLock servicemix.lock.level=50 servicemix.lock.delay=10 servicemix.lock.jdbc.url=jdbc:oracle:thin:@frodo:1521:blah servicemix.lock.jdbc.driver=oracle.jdbc.driver.OracleDriver servicemix.lock.jdbc.user=ade servicemix.lock.jdbc.password=eda servicemix.lock.jdbc.table=SERVICEMIX_LOCK servicemix.lock.jdbc.clustername=smx4 servicemix.lock.jdbc.timeout=30 ]] We get the following error on ServiceMix startup. Could not obtain lock: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor The Connection descriptor used by the client was: frodo:1521:blah;create=true
          Hide
          Gary Tully added a comment -

          thanks.

          Show
          Gary Tully added a comment - thanks.
          Hide
          Willem Jiang added a comment -

          Yes, I can reproduce the issue.
          I did a quick fix patch for it on servicemix-kernel, it is same with felix Karaf .

          Because of the bad internet connection to the north american, I have trouble to create the JIRA in Apache JIRA, so I submit the patch into this JIRA.

          BTW, the table name should be low case , if you use the postgresql
          servicemix.lock.jdbc.table=servcicemix_lock

          Show
          Willem Jiang added a comment - Yes, I can reproduce the issue. I did a quick fix patch for it on servicemix-kernel, it is same with felix Karaf . Because of the bad internet connection to the north american, I have trouble to create the JIRA in Apache JIRA, so I submit the patch into this JIRA. BTW, the table name should be low case , if you use the postgresql servicemix.lock.jdbc.table=servcicemix_lock
          Hide
          Willem Jiang added a comment -

          The patch is committed in the Karaf and Fuse ESB fuse kernel trunk.

          Show
          Willem Jiang added a comment - The patch is committed in the Karaf and Fuse ESB fuse kernel trunk.

            People

            • Assignee:
              Willem Jiang
              Reporter:
              Adrian Trenaman
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: