PHP problem with selecting from Oracle global temporary table

I have an Oracle global temporary table that is "ON COMMIT DELETE ROWS".

I have a loop in which I:

  • Paste into the global temporary table
  • Select from global temporary table (post-processing)
  • Commit so that the table is cleared before the next iteration of the loop

Insertion is performed with oci_execute ($ stmt, OCI_DEFAULT). The extraction is done by calling oci_fetch_all ($ stmt, $ result, 0, -1, OCI_FETCHSTATEMENT_BY_ROW | OCI_ASSOC). After that, the commit is performed: oci_commit ().

The problem is that the search sometimes works, and someday I get one of the following errors:

  • ORA-08103: object no longer exists
  • ORA-01410: Invalid ROWID

It is as if the session cannot β€œsee” the records that it previously inserted.

Do you have any ideas what might be causing this?

Thank.

+3
source share
1 answer

Are you using a connection pool? If so, then it may happen that different calls are made in separate sessions.

A better solution would be to have one PL / SQL procedure that populates the temporary table and returns the result set specified by one call. Which then offers an even better solution: delete the temporary table altogether.

Oracle , . SQL , , . ?

- . PL/SQL () , , . , , , .

, , 200 000 PHP ? , , .

+2

Source: https://habr.com/ru/post/1743981/


All Articles