Modified:
branches/branch_3_1/connector-j/src/com/mysql/jdbc/Connection.java
Log:
Added Connection.isMasterConnection() for clients to be able to determine
if a multi-host master/slave connection is connected to the first host
in the list.
Modified: branches/branch_3_1/connector-j/src/com/mysql/jdbc/Connection.java
===================================================================
--- branches/branch_3_1/connector-j/src/com/mysql/jdbc/Connection.java 2005-08-23 03:24:03
UTC (rev 4122)
+++ branches/branch_3_1/connector-j/src/com/mysql/jdbc/Connection.java 2005-08-23 13:12:18
UTC (rev 4123)
@@ -3869,6 +3869,17 @@
public synchronized boolean isClosed() {
return this.isClosed;
}
+
+ /**
+ * Is this connection connected to the first host in the list if
+ * there is a list of servers in the URL?
+ *
+ * @return true if this connection is connected to the first in
+ * the list.
+ */
+ public synchronized boolean isMasterConnection() {
+ return !this.failedOver;
+ }
/**
* Is the server in a sql_mode that doesn't allow us to use \\ to escape
| Thread |
|---|
| • Connector/J commit: r4123 - branches/branch_3_1/connector-j/src/com/mysql/jdbc | mmatthews | 23 Aug |