[ruby-oci8-devel] propose to implement pooling technology for Ruby-OCI8

KUBO Takehiro kubo at jiubao.org
Mon Dec 31 00:02:05 EST 2007


On Dec 29, 2007 6:25 PM, shiwei zhang <shiwei.zhang at oracle.com> wrote:

>  I plan to choose OCISessionGet() for both connection pooling and session
> pooling, because OCISessionBegin() can't work in session pooling.


>  And for now I plan to provide pooling only for T_IMPLICIT, not for
> T_EXPLICIT, because: (1) OCI_SYSDBA, OCI_SYSOPER are not supported by
> pooling. (2) external credential is not supported by session pooling. (3)
> external credential is probably not supported by connection pooling.

I think you need to add a enum value T_POOL or so. It may be better to use  more
explanatory name as T_IMPLICIT -> T_OCI_LOGON, T_EXPLICIT ->

ruby-oci8 supports Oracle 8.0 or later. Look at the following URL.

You may have known already. But I notice to make sure.
1. OCI8::ConnectionPool and OCI8::SessionPool must be defined by
  not rb_define_class_under because OCICPool and OCISPool are both OCI Handle.
2. When OCI8.new(user, pass, pool) is called, set pool as a parent of
an instance of OCI8
  by oci8_link_to_parent().
3. Add a mark function to OCI8 and call rb_gc_mark() to prevent  its
parent.from being freed.

static oci8_base_class_t oci8_svcctx_class = {
    NULL,  <- add a new mark callback function.

More information about the ruby-oci8-devel mailing list