Skip to content

Commit

Permalink
Use new query counter when testing whether to disconnect and reconnect
Browse files Browse the repository at this point in the history
to database server for the Cubrid and MySQLi connectors (already
implemented for MySQL classic connector).
  • Loading branch information
lsproc committed Dec 26, 2015
1 parent 3fdec4c commit 3a92684
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cubrid/ez_sql_cubrid.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 142,7 @@ function sysdate()
function query($query)
{
// This keeps the connection alive for very long running scripts
if ( $this->num_queries >= 500 )
if ( $this->count(false) >= 500 )
{
$this->disconnect();
$this->connect($this->dbuser,$this->dbpassword,$this->dbname,$this->dbhost,$this->dbport);
Expand Down
2 changes: 1 addition & 1 deletion mysqli/ez_sql_mysqli.php
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 206,7 @@ function query($query)
{

// This keeps the connection alive for very long running scripts
if ( $this->num_queries >= 500 )
if ( $this->count(false) >= 500 )
{
$this->disconnect();
$this->quick_connect($this->dbuser,$this->dbpassword,$this->dbname,$this->dbhost,$this->dbport,$this->encoding);
Expand Down

0 comments on commit 3a92684

Please sign in to comment.