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

shiwei zhang shiwei.zhang at oracle.com
Sun May 4 01:13:53 EDT 2008


Regarding the pooling support, it's ok if we skip over the connection 
pooling and only deliver the session pooling as default for ruby users. 
Only providing session pooling as default can make the story more easily 
understandable for ruby users. I will confirm this with you tomorrow or 
in couple days. I can comment/delete the codes about the connection 
pooling in the pooling patch.

Regarding the FAN support I prefer to set a global variable, thank you 
and Kubo for the suggestion. I can test the functionality, but it's hard 
to give out a snippet of test codes specific to the FAN assertion. I 
haven't seen this kind of test codes in  Php_Oci8 either. Do you think 
it's necessary to give out the test codes for FAN assertion?

Thanks & Best Regards,

Christopher Jones wrote:
> Setting OCI_EVENT enables ruby-oci8 to receive FAN events.  If
> ruby-oci8 uses the OCI session pool, these events will be
> automatically handled by the session pool. The DB must be configured
> to broadcast FAN events.  The new PHP whitepaper
> http://www.oracle.com/technology/tech/php/pdf/php-scalability-ha-twp.pdf
> shows the command the DBA would use.  You have already seen the PHP
> OCI8 code that sets OCI_EVENTS at
> http://cvs.php.net/viewcvs.cgi/php-src/ext/oci8/oci8.c?revision= 
> I'd recommend (i) making ruby-oci8 (i) making the OCI session pool
> default (and not bothering with OCI client connection pool - sorry
> Shiwei) (ii) making the event setting optional (as Shiwei indicates),
> since setting OCI_EVENT will start a monitoring thread.
> Chris
> KUBO Takehiro wrote:
> > Hi,
> >
> > 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 
> > repository, it just need to pass OCI_EVENTS to OCIInitialize()'s first
> > parameter.
> > 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.
> > _______________________________________________
> > ruby-oci8-devel mailing list
> > ruby-oci8-devel at rubyforge.org
> > http://rubyforge.org/mailman/listinfo/ruby-oci8-devel

More information about the ruby-oci8-devel mailing list