[ruby-oci8-commit] [565] trunk/ruby-oci8: call OCIStmtPrepare2() without GVL to prevent OCI8#parse from blocking ruby itself

nobody at rubyforge.org nobody at rubyforge.org
Sat Mar 16 14:43:39 UTC 2013


Revision: 565
Author:   kubo
Date:     2013-03-16 14:43:39 +0000 (Sat, 16 Mar 2013)
Log Message:
-----------
call OCIStmtPrepare2() without GVL to prevent OCI8#parse from blocking ruby itself
while the connection is used by another thread even though non-blocking mode is set.

Modified Paths:
--------------
    trunk/ruby-oci8/ChangeLog
    trunk/ruby-oci8/ext/oci8/apiwrap.yml
    trunk/ruby-oci8/ext/oci8/stmt.c

Modified: trunk/ruby-oci8/ChangeLog
===================================================================
--- trunk/ruby-oci8/ChangeLog	2013-03-09 11:35:12 UTC (rev 564)
+++ trunk/ruby-oci8/ChangeLog	2013-03-16 14:43:39 UTC (rev 565)
@@ -1,3 +1,9 @@
+2013-03-16  KUBO Takehiro  <kubo at jiubao.org>
+	* ext/oci8/apiwrap.yml, ext/oci8/stmt.c: call OCIStmtPrepare2()
+	    without GVL to prevent OCI8#parse from blocking ruby itself
+	    while the connection is used by another thread even though
+	    non-blocking mode is set.
+
 2013-03-09  KUBO Takehiro  <kubo at jiubao.org>
 	* ruby-oci8.gemspec: revert the previous commit because old
 	    rubygems doesn't support:

Modified: trunk/ruby-oci8/ext/oci8/apiwrap.yml
===================================================================
--- trunk/ruby-oci8/ext/oci8/apiwrap.yml	2013-03-09 11:35:12 UTC (rev 564)
+++ trunk/ruby-oci8/ext/oci8/apiwrap.yml	2013-03-16 14:43:39 UTC (rev 565)
@@ -1343,7 +1343,7 @@
             - dvoid *envhp
             - const oratext *name
 
-OCIStmtPrepare2:
+OCIStmtPrepare2_nb:
   :version: 920
   :args:
             - OCISvcCtx *svchp

Modified: trunk/ruby-oci8/ext/oci8/stmt.c
===================================================================
--- trunk/ruby-oci8/ext/oci8/stmt.c	2013-03-09 11:35:12 UTC (rev 564)
+++ trunk/ruby-oci8/ext/oci8/stmt.c	2013-03-16 14:43:39 UTC (rev 565)
@@ -61,7 +61,7 @@
     if (!NIL_P(sql) && oracle_client_version >= ORAVER_9_2) {
         OCI8SafeStringValue(sql);
 
-        rv = OCIStmtPrepare2(svcctx->base.hp.svc, &stmt->base.hp.stmt, oci8_errhp, RSTRING_ORATEXT(sql), RSTRING_LEN(sql), NULL, 0, OCI_NTV_SYNTAX, OCI_DEFAULT);
+        rv = OCIStmtPrepare2_nb(svcctx, svcctx->base.hp.svc, &stmt->base.hp.stmt, oci8_errhp, RSTRING_ORATEXT(sql), RSTRING_LEN(sql), NULL, 0, OCI_NTV_SYNTAX, OCI_DEFAULT);
         if (IS_OCI_ERROR(rv)) {
             chker2(rv, &svcctx->base);
         }



More information about the ruby-oci8-commit mailing list