Jump to content

Preventing AUTO COMMIT/ROLLBACK


dvd420

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

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.