I’m writing php web-app using unholy alliance of php+oracle+iis 🙂
every time script being executed I create a new connection to db – and it takes time:
class ORACLE_layer {
public function __construct($usr, $pwd, $db) {
$this->conn = oci_connect ("...")
}
function __destruct() {
oci_close($this->conn);
}
}
I heard of “persistent connections”.
Should I use them? “oci_pconnect”
Do I need to remove the line: “oci_close($this->conn);” from “__destruct”?
Whether you should use them or not cannot be answered without some consideration:
Check out
to learn more about connecting to Oracle from PHP efficiently.