[ruby-oci8-devel] Support FAN in Ruby-OCI8

KUBO Takehiro kubo at jiubao.org
Sun Apr 27 01:10:23 EDT 2008


On Fri, Apr 11, 2008 at 5:28 PM, shiwei zhang <shiwei.zhang at oracle.com> wrote:
> Hi, Kubo, ruby-oci8-devel,
>  I want to implement FAN (Fast Application Notification) functionality
>  for Ruby-OCI8. Do you have any concerns about this?
>  When we've supported FAN in  Ruby-OCI8, ruby users can still use nearly
>  the same APIs to talk to Oracle DB. They are able to choose FAN enabled
>  or disabled when using Ruby-OCI8. For single DB instance it's not
>  critical to enable FAN, but for multiple DB instances it's much more
>  beneficial to enable FAN. In PHP, if a user wants to enable FAN he needs
>  to setup "oci8.events = On" in the file php.ini. Yet in Ruby-OCI8 we
>  don't have the configuration file like php.ini, so how should we provide
>  an interface for ruby user to feed in his choice? Add a parameter in
>  OCI8.new()? Add a configuration method for the class OCI8? Do you have
>  some suggestions?

What API calls do we need to  implement FAN? As far as I looked at PHP CVS
repository, it just need to pass OCI_EVENTS to OCIInitialize()'s first
Is it correct?

If so, we can not use OCI8.new() to enable FAN, because OCI Environment
is initialized before OCI8 class is defined.
Two ideas:
1. set a global variable before requiring oci8.
       $oci8_events = true
       require 'oci8'
2. initialize OCI Environment when it is needed.
       require 'oci8'  # don't initialize OCI Environment yet.
       OCI8.events = true
       conn = OCI8.new(...)   # initialize OCI Environment.

More information about the ruby-oci8-devel mailing list