One of the problems of using CakePHP with an Oracle database is that CakePHP does not utilize bind variables. One of the advantages of Oracle is that it can cache query results based on queries, as long as those queries use bind variables and not strings. An example of a query using binds looks like:
SELECT
*
FROM
my_table
WHERE
id = :myBind;
$bingArray = array(
'myBind' => 12
);
When I first started working with Oracle, I was not aware of the usefulness of bind variables. But after an application I had written that did not use bind variables failed to maintain stability under heavy load, a more experience Oracle developer sat down with me and helped me test the application with bind variables. We saw a great increase in stability under high loads and I was sold. CakePHP had to utilize bind variables.
After a ton of debugging and a lot of live testing on a site that gets 5+ million visitors a month, I am finally ready to release the CakePHP 1.2 Oracle connection class. During development of the class, a lot of the inherited methods from dbo_source.php had to be moved into dbo_oracle.php in order to get things to work correctly. Something that is missing is a way to debug the actual value of the bind variables. I wrote a custom debug level which allowed us to turn on output of just the queries or of the queries and the bind variable values.
This change removes the need for use of the
clob and blob behaviors.
Downloads:
dbo_source.php |
dbo_oracle.php