Jump to content

Recommended Posts

Hi All,

 

This is regarding oci. When the script ends, PHP ROLLBACKs all the transactions, if we are not passing OCI_COMMIT_ON_SUCCESS while calling oci_execute(). My problem is, I don't need this ROLLBACK after the script ends. I want to do COMMIT/ROLLBACK myself.

 

So is there any way to do so.

Link to comment
https://forums.phpfreaks.com/topic/141920-preventing-auto-commitrollback/
Share on other sites

ok most times with objects (I'm assuming OCI is a package or something)

 

when you do like

$oci = new OCI;

echo $oci;

 

when you echo the variable it activates the ->toString() method inside the function which then gives the output in STRING form..

 

most pre-built objects have this, however, if you're working on a class you'd use __toString with the prepended underscores.

 

now, you can't store a resource/stream/object inside of a session or file either basically because its impossible for the script to keep the connection/stream alive when php terminates.

 

what you can do, is pass the data that you will USE with OCI via sessions

OCI is database extension for Oracle.

 

The whole point of transactions is, that if for whatever reason database doesn't get the COMMIT command (imagine connection timing out), it will roll back all changes.I never worked with Oracle, so I don't know if it has equivalent of MySQL's AUTOCOMMIT setting, that autmatically commits every single query.

 

See oci_commit

 

 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.