Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PDO_OCI vs OCI8

Tags:

php

pdo

oci8

I'm working on a new project and trying to determine if I should use PDO_OCI or oci8 for a database connection. Unfortunately I don't think anyone has really compared the two.

The information I have is as follows so that you know why I'm concerned about the choice. OCI8 is developed by Oracle(AFAIK) so this seems to be a solid choice. I prefer PDO but it doesn't look like the PDO_OCI extension has been updated in some time and its still marked as experimental on the PHP docs page.

If anyone can give me any thoughts on why you would / wouldn't use one or the other so that I can go into this with a little more of an understanding of which is better that would be great.

like image 726
Christian South Avatar asked May 10 '11 19:05

Christian South


2 Answers

I was very nervous about using PDO_OCI with the Experimental note. However, I saw a major advantage to standardizing our database connections on PDO across the corporation because of its data abstraction. I implemented some tests to make sure that data would make it to the database and that it could with stand the anticipated load. At this point it has processed about 15,000 records successfully.

The note on php.net about it says the names and function may change in a future release of PHP. I plan to test my implementation before we would upgrade to ensure the functionality hasn't changed, but we would probably do that any way.

I can say that it works well for us.

like image 132
Issac Avatar answered Nov 07 '22 15:11

Issac


I copy answer from this thread: Oracle, PDO_OCI vs OCI8

It seems to me that Oracle is not interested in developing a driver for PDO it's developing it's own driver to keep you close to oracle database... to oracle driver... etc. :)

As far as I've seen there is no problem if you can cope with max. texts of VARCHAR2 of 4000 CHARS. If you need CLOBs (and/or bigger) don't go with PDO_OCI.

like image 24
Rauni Lillemets Avatar answered Nov 07 '22 15:11

Rauni Lillemets