cvs: php-src(PHP_5_2) /ext/oci8 oci8.c
| From: | Antony Dovgal | Date: | Wed, 09 Aug 2006 10:16:50 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/oci8 oci8.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-39862@lists.php.net to get a copy of this message | ||
tony2001 Wed Aug 9 10:16:50 2006 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/oci8 oci8.c
Log:
MFH: fix #8112 (Persistent connections misbehave when Apache process times out)
http://cvs.php.net/viewvc.cgi/php-src/ext/oci8/oci8.c?r1=1.269.2.16.2.13&r2=1.269.2.16.2.14&diff_format=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.269.2.16.2.13 php-src/ext/oci8/oci8.c:1.269.2.16.2.14
--- php-src/ext/oci8/oci8.c:1.269.2.16.2.13 Sun Aug 6 14:09:58 2006
+++ php-src/ext/oci8/oci8.c Wed Aug 9 10:16:50 2006
@@ -26,7 +26,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: oci8.c,v 1.269.2.16.2.13 2006/08/06 14:09:58 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.269.2.16.2.14 2006/08/09 10:16:50 tony2001 Exp $ */
/* TODO
*
* file://localhost/www/docs/oci10/ociaahan.htm#423823 - implement lob_empty() with
OCI_ATTR_LOBEMPTY
@@ -653,7 +653,7 @@
php_info_print_table_start();
php_info_print_table_row(2, "OCI8 Support", "enabled");
php_info_print_table_row(2, "Version", "1.2.1");
- php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.13 $");
+ php_info_print_table_row(2, "Revision", "$Revision: 1.269.2.16.2.14 $");
sprintf(buf, "%ld", OCI_G(num_persistent));
php_info_print_table_row(2, "Active Persistent Connections", buf);
@@ -1745,6 +1745,17 @@
connection = (php_oci_connection *)le->ptr;
if (connection->used_this_request) {
+ if ((PG(connection_status) & PHP_CONNECTION_TIMEOUT)) {
+ /* call OCIBreak() on timeout to avoid appearance of deadlocked persistent connections */
+ connection->errcode = PHP_OCI_CALL(OCIBreak, (connection->svc, connection->err));
+ if (connection->errcode != OCI_SUCCESS) {
+ php_oci_error(connection->err, connection->errcode TSRMLS_CC);
+ PHP_OCI_HANDLE_ERROR(connection, connection->errcode);
+ /* OCIBreak() failed. delete the connection */
+ return 1;
+ }
+ }
+
if (connection->descriptors) {
zend_hash_destroy(connection->descriptors);
efree(connection->descriptors);