First page Back Continue Last page Overview Graphics
Selecting The DB Handle
get_db_handle() is the only thing that knows which handle we are using:
sub get_db_handle {
return $MEMORY_DBH if ( CACHING_ENABLED );
return get_pairnic_dbh()
}
Notes:
Once the data was imported, our code was updated to use get_db_handle, which abstracted away the decision of which handle we were connecting to.
Now, we could connect to the live data, or to the cache, just by changing a constant.