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.
[[
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