Oracle 5.0 Reference Manual page 2647

Table of Contents

Advertisement

Mysqlnd replication and load balancing plugin (mysqlnd_ms)
As of PHP 5.4.0 the mysqlnd library allows the plugin
to monitor the
the libraries
set_stickiness=master
a PHP MySQL extension invoking the
function call set_autocommit(), the plugin is made aware of the
begin of a transaction. Then, the plugin stops load balancing and
directs all statements to the master server until
enabled. Thus, no SQL hints are required.
An example of a PHP MySQL API function calling the
mysqlnd
mysqli_autocommit.
Although setting trx_stickiness=master, the plugin cannot
be made aware of
statements such as
As of PHP 5.5.0, the mysqlnd library features additional C API
calls to control transactions. The level of control matches the one
offered by SQL statements. The
to use these calls. Since version 1.5.0, PECL/mysqlnd_ms can
monitor not only mysqli_autocommit, but also mysqli_begin,
mysqli_commit
boundaries and stop load balancing for the duration of a transaction.
Example 20.290. Using master to execute transactions
{
}
Since version 1.5.0 automatic and silent failover is disabled for
the duration of a transaction. If the boundaries of a transaction
have been properly detected, transaction stickiness is enabled
and a server fails, the plugin will not attempt to fail over to the next
server, if any, regardless of the failover policy configured. The user
must handle the error manually. Depending on the configuration,
the plugin may emit an error of type
(mysqlnd_ms) Automatic failover is not permitted
in the middle of a
be overwritten by follow up errors such as
connection selected by the last
will be generated by the failing query function.
autocommit
set_autocommit()
library internal function call
autocommit
SET AUTOCOMMIT=0
and
mysqli_rollback
"myapp": {
"master": {
"master_0": {
"host": "localhost"
}
},
"slave": {
"slave_0": {
"host": "192.168.78.136",
"port": "3306"
}
},
"trx_stickiness": "master"
}
transaction. This error may then
2627
mode set by calls to
function. If setting
and
gets disabled by
autocommit
library internal
mysqlnd
autocommit
set_autocommit()
mode changes caused by SQL
or BEGIN.
API has been modified
mysqli
to detect transaction
reading like
E_WARNING
(mysqlnd_ms) No
filter. Those errors
is
is

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mysql 5.0

Table of Contents