Uploaded image for project: 'Karaf'
  1. Karaf
  2. KARAF-2523

Karaf JDBC lock doesn't work with M$ SQLServer

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.3.0
    • Fix Version/s: 2.4.0, 3.0.0, 2.3.4
    • Component/s: karaf
    • Labels:
      None

      Description

      Using the M$ SQLServer (with jtds) as lock backend (and the Karaf default JDBC lock implementation) with this configuration:

      #setup in system.properties

      karaf.lock=true
      karaf.lock.class=org.apache.karaf.main.DefaultJDBCLock
      karaf.lock.level=50
      karaf.lock.delay=10
      karaf.lock.jdbc.url=jdbc:jtds:sqlserver://xxx;databaseName=evillarr
      karaf.lock.jdbc.driver=net.sourceforge.jtds.jdbc.Driver
      karaf.lock.jdbc.user=xxx
      karaf.lock.jdbc.password=xxx
      karaf.lock.jdbc.table=KARAF_LOCK
      karaf.lock.jdbc.clustername=karaf
      karaf.lock.jdbc.timeout=30

      Karaf doesn't start because it can't acquire the lock:

      2013-10-21 09:47:42 | WARN | Thread-28 | - - | Failed to acquire database lock: java.sql.SQLException: Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.

      As SQLServer doesn't support the "select ... for update" statement, we have to provide a MSSQLServerLock implementation using a different SQL query.

        Attachments

          Activity

            People

            • Assignee:
              jbonofre Jean-Baptiste Onofré
              Reporter:
              jbonofre Jean-Baptiste Onofré
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: