Effective October 27, 2012, online and email support for FuseSource products will move to Red Hat support channels. For more information, please see the JIRA Migration to Red Hat FAQ.
As of October 27th, please open all new issues in the Red Hat Customer Portal .
Issue Details (XML | Word | Printable)

Key: ESB-821
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Willem Jiang
Reporter: Adrian Trenaman
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
FUSE ESB

FUSE ESB 4 Failover does not work with PostgreSQL and Oracle

Created: 10/Aug/09 03:59 PM   Updated: 03/Sep/09 10:57 AM
Component/s: Core
Affects Version/s: 4.1.0.2-fuse
Fix Version/s: 4.2.0.0M1-fuse

File Attachments: 1. Text File ESB-821.patch (1 kB)



 Description  « Hide
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.



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Adrian Trenaman added a comment - 18/Aug/09 09:30 AM
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


Gary Tully added a comment - 18/Aug/09 10:23 AM
thanks.

Willem Jiang added a comment - 19/Aug/09 06:15 AM
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


Willem Jiang added a comment - 27/Aug/09 02:27 AM
The patch is committed in the Karaf and Fuse ESB fuse kernel trunk.