1 message in com.mysql.lists.javaJDBC failover and autocommit| From | Sent On | Attachments |
|---|---|---|
| Crouch, Luke H. | 28 Jul 2004 11:55 |
| Subject: | JDBC failover and autocommit![]() |
|---|---|
| From: | Crouch, Luke H. (Luke...@red-man.com) |
| Date: | 07/28/2004 11:55:00 AM |
| List: | com.mysql.lists.java |
we are running a CFMX environment, and have downloaded the Connector/J 3.0 and
are using it as our driver from the CFMX applications to mysql. we have 4
different mysql servers (part of an NDB cluster), and the 4 mysql servers are on
different machines, with different IP addresses. so in our JDBC connection url,
we have:
jdbc:mysql://<host1>,<host2>,<host3>,<host4>/<dbName>?failOverReadOnly=false&relaxAutoCommit=true
we set the relaxAutoCommit because we're trying to keep all the JDBC
configuration transparent to the CF scripts, and apparently the autoCommit is
false by default, with no way to change it via the connection URL? and
autoCommit must be true for the failover to occur.
the problem we have now is that the failover doesn't seem to be happening
automatically before a connection is attempted. when we kill one of the servers
and test a script, it gives us an error the first time, then when we test it the
second time, it seems to pick up on the first one's error, and it fails over to
the next server in the list...how can we get this failover to happen seamlessly
without having an error on the first try, but having the connection just
immediately try the next host?
also, is there a way to set the autocommit to true inside the url string? or
some other way that would be transparent to CFMX, as in, we don't actually use
Java code to get our connection and driver, CFMX does that for us. we can use
Java code inside our CFMX if we need, but would like to avoid it since only 1
developer here knows Java...
thanks, -L
Luke Crouch IS Developer Red Man Pipe & Supply 918-461-5326 luke...@red-man.com **NOTE: MY EMAIL HAS CHANGED AS OF 6/17/2004**




