Changeset 3146

Show
Ignore:
Timestamp:
05/03/08 15:45:27 (2 months ago)
Author:
pmjones
Message:

Solar_Sql_Adapter: [FIX] Fixes cache conflicts across multiple connections. Patch from Rodrigo Moraes; thanks, Rodrigo. :-)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Solar/Sql/Adapter.php

    r3138 r3146  
    235235     */ 
    236236    protected $_profiling = false; 
     237 
     238    /** 
     239     *  
     240     * A PDO-style DSN, for example, "mysql:host=127.0.0.1;dbname=test" 
     241     *  
     242     * @var string 
     243     *  
     244     */ 
     245    protected $_dsn; 
    237246     
    238247    /** 
     
    248257        $this->_cache = Solar::dependency('Solar_Cache', $this->_config['cache']); 
    249258        $this->setProfiling($this->_config['profiling']); 
     259         
     260        // build a DSN 
     261        $this->_dsn = $this->_dsn(); 
     262         
     263        // save the cache-key prefix 
     264        $this->_cache_key_prefix = get_class($this) . '/' . md5($this->_dsn); 
    250265    } 
    251266     
     
    343358        $before = microtime(true); 
    344359         
    345         // build a DSN 
    346         $dsn = $this->_dsn(); 
    347          
    348         // save the cache-key prefix 
    349         $this->_cache_key_prefix = get_class($this) . '/' . md5($dsn); 
    350          
    351360        // attempt the connection 
    352361        $this->_pdo = new PDO( 
    353             $dsn, 
     362            $this->_dsn, 
    354363            $this->_config['user'], 
    355364            $this->_config['pass']