Documentation Home
MySQL Connector/J 5.1 Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 478.3Kb
PDF (A4) - 478.8Kb
EPUB - 146.1Kb
HTML Download (TGZ) - 119.5Kb
HTML Download (Zip) - 146.0Kb


MySQL Connector/J 5.1 Developer Guide  /  Multi-Host Connections

Chapter 8 Multi-Host Connections

The following sections discuss a number of topics that involve multi-host connections, namely, server load-balancing, failover, and replication.

Developers should know the following things about multi-host connections that are managed through Connector/J:

  • Each multi-host connection is a wrapper of the underlying physical connections.

  • Each of the underlying physical connections has its own session. Sessions cannot be tracked, shared, or copied, given the MySQL architecture.

  • Every switch between physical connections means a switch between sessions.

  • Within a transaction boundary, there are no switches between physical connections. Beyond a transaction boundary, there is no guarantee that a switch does not occur.

    Note

    If an application reuses session-scope data (for example, variables, SSPs) beyond a transaction boundary, failures are possible, as a switch between the physical connections (which is also a switch between sessions) might occur. Therefore, the application should re-prepare the session data and also restart the last transaction in case of an exception, or it should re-prepare session data for each new transaction if it does not want to deal with exception handling.


User Comments
Sign Up Login You must be logged in to post a comment.