PostgreSQL Clustering: JDBC

Now that I’ve got my basic active/passive cluster setup using the shared disk Linux heartbeat method mentioned here. One thing is left, and that’s allowing my java app to fail-over to the new database without re-coding the app.

Without updating the JDBC driver you would have to catch the failure at the java container level or in the app itself and manage the switch from the down node to the active node.
I don’t think that’s “industry standard” and it’s certainly not easy by any means.
The normal way is to let the JDBC driver manage it.

Unfortunately the PostgreSQL JDBC driver doesn’t handle this event out of the box so we need to invoke a 3rd party.

There aren’t a lot of options in this area here are two:

I found a good discussion around HA-JDBC here

I’m using Hibernate + Geronimo so i need to do testing to see if that’s going to work with HA-JDBC but from the sounds of it, it should work just fine.

I’ll need to evaluate both of these to determine which is the best.

Leave a comment

0 Comments.

Leave a Reply


[ Ctrl + Enter ]