Re: PEAR oci8 interface problem
| From: | Martin Jansen | Date: | Sat, 28 Sep 2002 10:47:01 +0000 |
| Subject: | Re: PEAR oci8 interface problem | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-9634@lists.php.net to get a copy of this message | ||
[pear-dev: This message was originally sent to pear-general.]
On Fri Sep 27, 2002 at 03:0757PM -0400, Dave Sugar wrote:
> Here is what I found - maybe we are using the interface incorrectly, but
> from what I can tell it is a problem.
>
> There is a case at our website where a user can upload a comma delimited
> file which contains a list of additional user accounts to create. Each user
> account is a single row in a database, requiring an single SQL insert to
> create each one. So this code is executing in a loop.
>
> I noticed that in oci8.php in the functions 'simpleQuery' and 'execute'
> the result from OCIParse (the query) is assigned to $this->last_stmt. But
> freeResult is NEVER called so OCIFreeStatement is never called. This is OK
> when calling select statements (which use prepare/execute) because they are
> returned in DB_Results which has a 'free' function. But for inserts and
> updates this is a problem.
>
> If doing enough insert or updates eventually you will get an error in
> oracle about 'Too many open cursors'. I was able to fix the problem by
> writing my own version of the functions simpleQuery and execute which call
> 'freeResult' if the query matches DB::isManip.
>
> I know the change we made will break the functions numRows, errorNative
> and affectedRows, but we are not using these functions so it is OK for us.
> I tried to work on a change to correct oci8.php, but it didn't seem to be
> working correctly and I don't have enough insight into the design of the
> oci8.php interface to know what else I might be breaking.
If you could put your patch somewhere up on the web, people with
better knowledge of oci8.php could perhaps have a look at this in
order to create a patch that does not break numRows, et al.
--
- Martin Martin Jansen
http://martinjansen.com/