Previous Topic

Next Topic

Book Contents

Connect Elements Example: DataBase

The following example shows a DataBase verifier that establishes up to 50 simultaneous connections to the MySQL data base called email_addresses hosted on MySQL database servers listening at 10.11.12.1, 10.11.12.2 and 10.11.12.3. Each time a new connection is needed, a random one is selected from these three.

If a connection to the randomly selected host fails due to an error, then the application randomly tries one of the other two hosts. If that one fails as well, the third and final host is tried. Only if all three fail to connect properly will the pending command fail.

If two of the three hosts are unresponsive for some time, then the pool of connections consists of connections to the one responsive host. The application will not renegotiate connections to the failed hosts unless some of the cached connections for the functional host fail or are shutdown due to idleness. Enumerations take place entirely on the first free cached connection.

<Vrfy version = "101.4635"

name = "My MySQL Verifier"

uid = "64378E86-A459-11DD-1273-09173F13E4C5">

<DataBase>

<Vendor>mysql</Vendor>

<DataBase>email_addresses</DataBase>

<Host>10.11.12.1</Host>

<Host>10.11.12.2</Host>

<Host>10.11.12.3</Host>

<HostListOrder>Shuffle</HostListOrder>

</DataBase>

</Vrfy>