Running active/passive mode with JDBC lock for MS SQL prevents karaf starting

Solution Unverified - Updated -

Environment

  • Fuse ESB 7.1
  • JBoss Fuse 6.0

Issue

When using MS SQL (with jtds) as lock backend and the default JDBC lock implementation with this configuration I see the following error:

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://x.x.x.x:1433;databaseName=evillarr
karaf.lock.jdbc.driver=net.sourceforge.jtds.jdbc.Driver
karaf.lock.jdbc.user=xxx
karaf.lock.jdbc.password=xxxx
karaf.lock.jdbc.table=KARAF_LOCK
karaf.lock.jdbc.clustername=karaf
karaf.lock.jdbc.timeout=30
Error in fuseesb.log
 2013-10-21 10:03:16 | WARN  | Thread-28 | Failed to acquire database lock: java.sql.SQLException: 
Line 1: FOR UPDATE clause allowed only for DECLARE CURSOR.

And karaf doesn't start anymore.

Resolution

Class SQLServerJDBCLock needed to be created to avoid multiple karaf instances attempting to become master using MS SQL Server with JTDS driver. This issue is fixed in JBoss Fuse 6.1.

Root Cause

Bug ENTESB-959 / KARAF-2523.

This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.