From 7fff1b51ac0379138f52cad6d520c80dccbffa68 Mon Sep 17 00:00:00 2001 From: Christian Schneider Date: Sun, 17 Jan 2010 15:39:54 +0000 Subject: Reduce number of put calls to it_cache --- it_dbi.class | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'it_dbi.class') diff --git a/it_dbi.class b/it_dbi.class index 0aedb07..918fc4c 100644 --- a/it_dbi.class +++ b/it_dbi.class @@ -221,7 +221,7 @@ function _connect($p = array()) $this->_fatal("_connect(): can't select database \"{$p['db']}\""); $state['link'] = $this->_link; - it_dbi::_state_put($dbid, $state); + it_dbi::_state_put($dbid, $state, false); # Store only locally as link is not shared anyway } } @@ -759,11 +759,12 @@ function _state_get($dbid) return $result; } -function _state_put($dbid, $state) +function _state_put($dbid, $state, $shared = true) { #var_dump("put", $dbid, $state); $GLOBALS['it_dbi']->_state[$dbid] = $state; - it_cache::put("dbi:$dbid", array('link' => null) + (array)$state); # link is not transferable + if ($shared) + it_cache::put("dbi:$dbid", array('link' => null) + (array)$state); # link is not transferable } function _state_purgeshared($dbid) -- cgit v1.2.3