From kubo at jiubao.org Tue Apr 1 01:47:53 2008 From: kubo at jiubao.org (KUBO Takehiro) Date: Tue, 1 Apr 2008 14:47:53 +0900 Subject: [ruby-oci8-devel] About XML DB support in Ruby-OCI8 In-Reply-To: <5d847bcd0803270328s110fe466hef0ff814f9fde370@mail.gmail.com> References: <47D74D2F.4010703@oracle.com> <5d847bcd0803130730y2fb71cd1tba62d673f5d6060a@mail.gmail.com> <47E20209.2020806@oracle.com> <87bq59o2ku.fsf@lilliput.jiubao.org> <47E9C01C.5070300@oracle.com> <5d847bcd0803270328s110fe466hef0ff814f9fde370@mail.gmail.com> Message-ID: <5d847bcd0803312247j3c443991g11c5d4fa6ebf7312@mail.gmail.com> Hi Liming, I have found an other way to support XML. It just add the following code at the end of lib/oci8/oci8.rb -------------------------------------------------------- autoload(:REXML, 'rexml/document') class OCI8 module BindType class REXML < OCI8::BindType::Long def set(val) super(val && val.to_s) end def get (val = super) && ::REXML::Document.new(val) end end end end OCI8::BindType::Mapping[:xmltype] = OCI8::BindType::REXML -------------------------------------------------------- We can add support for other XML libraries easily. For example: -------------------------------------------------------- # Hpricot: http://code.whytheluckystiff.net/hpricot/ require 'rubygems' require 'hpricot' class OCI8 module BindType class HpricotXML < OCI8::BindType::Long def set(val) super(val && val.to_s) end def get (val = super) && ::Hpricot.XML(val) end end end end OCI8::BindType::Mapping[:xmltype] = OCI8::BindType::HpricotXML -------------------------------------------------------- libxml ruby binding will be made by similar way. From shiwei.zhang at oracle.com Fri Apr 11 04:28:24 2008 From: shiwei.zhang at oracle.com (shiwei zhang) Date: Fri, 11 Apr 2008 16:28:24 +0800 Subject: [ruby-oci8-devel] Support FAN in Ruby-OCI8 In-Reply-To: <47947ADD.5050701@oracle.com> References: <47622312.8070500@oracle.com> <87tzmgj71k.fsf@lilliput.jiubao.org> <476A3101.2030103@oracle.com> <476B8790.4080409@oracle.com> <873ats17pb.fsf@lilliput.jiubao.org> <47761299.3060306@oracle.com> <5d847bcd0712302102h43288ac5oe51d0ed1f0534db@mail.gmail.com> <47903B41.5030601@oracle.com> <5d847bcd0801172257w28d754fla41fff6242d0a2ef@mail.gmail.com> <47906414.1040904@oracle.com> <5d847bcd0801180151u1d6f787fqad5f937fde6c2e65@mail.gmail.com> <47947ADD.5050701@oracle.com> Message-ID: <47FF2128.8060300@oracle.com> 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? FAN Benefits: FAN is a notification mechanism that Oracle RAC uses to notify other processes about cluster configuration and service-level information, including status changes such as UP or DOWN events. FAN UP and DOWN events can apply to instances, services, and nodes. FAN also publishes Load Balancing Advisory events. Without FAN, OCI8 can hang until a TCP timeout occurs and an error is returned, which might be several minutes. Enabling FAN in OCI8 can allow your applications to detect errors and re-connect to an available database instance without the user being aware of an outage. http://download.oracle.com/docs/cd/B28359_01/rac.111/b28254/rac_glossary.htm#sthref1765 Thanks & Best Regards, Shiwei From liming.lian at oracle.com Tue Apr 22 03:19:42 2008 From: liming.lian at oracle.com (Liming Lian) Date: Tue, 22 Apr 2008 15:19:42 +0800 Subject: [ruby-oci8-devel] Is it a typo of method name: "__defiend? " ? Message-ID: <480D918E.9010707@oracle.com> Hi Kubo, In stmt.c, a method definition is as rb_define_private_method(cOCIStmt, "__defiend?", oci8_stmt_defined_p, 1); Is here "__defiend?" a typo for "__defined?"? or is there any special meaning to define this method name? Liming From ted.behling at htc.hargray.com Wed Apr 23 11:00:31 2008 From: ted.behling at htc.hargray.com (Ted Behling) Date: Wed, 23 Apr 2008 11:00:31 -0400 Subject: [ruby-oci8-devel] Ruby OCI8 proxy authentication Message-ID: Hello, I would like to be able to use Oracle's "proxy authentication" feature from Ruby. My Web research and review of the ruby-oci8 source code indicate that this feature is unimplemented in ruby-oci8 and there are no plans to add it. I'd love to know if this is definitely the case. If proxy authentication is indeed unimplemented, I think adding this feature would be a strong enabler for getting ruby-oci8 to be more widely used in complex enterprise environments. Kubo or Liming, it would be great if you were to please comment on whether this is something you would be interested in adding to ruby-oci8. For your information, here are some good explanations of proxy authentication: http://download-uk.oracle.com/docs/cd/A97630_01/appdev.920/a96590/adgsec 03.htm http://jonathanlewis.wordpress.com/2006/12/18/proxy-users/ Thanks! Ted Behling ISP Systems Analyst, Hargray Communications ted.behling at htc.hargray.com From liming.lian at oracle.com Wed Apr 23 23:10:20 2008 From: liming.lian at oracle.com (Liming Lian) Date: Thu, 24 Apr 2008 11:10:20 +0800 Subject: [ruby-oci8-devel] Ruby OCI8 proxy authentication In-Reply-To: References: Message-ID: <480FFA1C.4030204@oracle.com> Hi Ted, Sounds like good feature. Better to hear Kubo's opinion on this, and could you please file a new ticket on the project tracker for feature request here: http://rubyforge.org/tracker/?atid=1054&group_id=256&func=browse Thanks, Liming > Hello, > > I would like to be able to use Oracle's "proxy authentication" feature > from Ruby. My Web research and review of the ruby-oci8 source code > indicate that this feature is unimplemented in ruby-oci8 and there are > no plans to add it. I'd love to know if this is definitely the case. > If proxy authentication is indeed unimplemented, I think adding this > feature would be a strong enabler for getting ruby-oci8 to be more > widely used in complex enterprise environments. > > Kubo or Liming, it would be great if you were to please comment on > whether this is something you would be interested in adding to > ruby-oci8. > > For your information, here are some good explanations of proxy > authentication: > > http://download-uk.oracle.com/docs/cd/A97630_01/appdev.920/a96590/adgsec > 03.htm > http://jonathanlewis.wordpress.com/2006/12/18/proxy-users/ > > Thanks! > > Ted Behling > ISP Systems Analyst, Hargray Communications > ted.behling at htc.hargray.com > _______________________________________________ > ruby-oci8-devel mailing list > ruby-oci8-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/ruby-oci8-devel > From shiwei.zhang at oracle.com Thu Apr 24 04:48:34 2008 From: shiwei.zhang at oracle.com (shiwei zhang) Date: Thu, 24 Apr 2008 16:48:34 +0800 Subject: [ruby-oci8-devel] Ruby OCI8 proxy authentication In-Reply-To: <480FFA1C.4030204@oracle.com> References: <480FFA1C.4030204@oracle.com> Message-ID: <48104962.7070108@oracle.com> Ted, It's appreciated if you can give out a detailed use case about this, how would you love best to pass arguments to OCI8.new() when you want to create a connection using Proxy Authentication? This is useful for us to define the requirements and then deliver the functionality. Of course we are willing to work out this functionality if it's really useful even necessary for ruby users. I think it's useful. :-) Best Regards, Shiwei Liming Lian wrote: > Hi Ted, > > Sounds like good feature. Better to hear Kubo's opinion on this, and > could you please file a new ticket on the project tracker for feature > request here: > > http://rubyforge.org/tracker/?atid=1054&group_id=256&func=browse > > Thanks, > Liming > > >> Hello, >> >> I would like to be able to use Oracle's "proxy authentication" feature >> from Ruby. My Web research and review of the ruby-oci8 source code >> indicate that this feature is unimplemented in ruby-oci8 and there are >> no plans to add it. I'd love to know if this is definitely the case. >> If proxy authentication is indeed unimplemented, I think adding this >> feature would be a strong enabler for getting ruby-oci8 to be more >> widely used in complex enterprise environments. >> >> Kubo or Liming, it would be great if you were to please comment on >> whether this is something you would be interested in adding to >> ruby-oci8. >> >> For your information, here are some good explanations of proxy >> authentication: >> >> http://download-uk.oracle.com/docs/cd/A97630_01/appdev.920/a96590/adgsec >> 03.htm >> http://jonathanlewis.wordpress.com/2006/12/18/proxy-users/ >> >> Thanks! >> >> Ted Behling >> ISP Systems Analyst, Hargray Communications >> ted.behling at htc.hargray.com >> _______________________________________________ >> ruby-oci8-devel mailing list >> ruby-oci8-devel at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ruby-oci8-devel >> >> > > _______________________________________________ > ruby-oci8-devel mailing list > ruby-oci8-devel at rubyforge.org > http://rubyforge.org/mailman/listinfo/ruby-oci8-devel > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/ruby-oci8-devel/attachments/20080424/91d7f76d/attachment.html From kubo at jiubao.org Sat Apr 26 01:48:17 2008 From: kubo at jiubao.org (KUBO Takehiro) Date: Sat, 26 Apr 2008 14:48:17 +0900 Subject: [ruby-oci8-devel] Ruby OCI8 proxy authentication In-Reply-To: References: Message-ID: <5d847bcd0804252248k5cfa824em77dd54643aae878d@mail.gmail.com> Hi, On Thu, Apr 24, 2008 at 12:00 AM, Ted Behling wrote: > Kubo or Liming, it would be great if you were to please comment on > whether this is something you would be interested in adding to > ruby-oci8. I myself have no plan to add the feature. My highest priority is releasing ruby-oci8 2.0. But it doesn't prevent anyone from contributing. If anyone make a patch and it is useful, I'll apply it to ruby-oci8. Note that I may not apply it if it is a patch for ruby-oci8 1.0. It would be postponed until ruby-oci8 2.0 also have same feature. If the patch is for ruby-oci8 2.0, I'll accept it. > For your information, here are some good explanations of proxy > authentication: As Shiwei said, how would you love best to pass arguments to OCI8.new() when you want to create a connection using Proxy Authentication? From kubo at jiubao.org Sat Apr 26 01:54:40 2008 From: kubo at jiubao.org (KUBO Takehiro) Date: Sat, 26 Apr 2008 14:54:40 +0900 Subject: [ruby-oci8-devel] Is it a typo of method name: "__defiend? " ? In-Reply-To: <480D918E.9010707@oracle.com> References: <480D918E.9010707@oracle.com> Message-ID: <5d847bcd0804252254q344c507au58c2b73b8d631ac2@mail.gmail.com> Hi, On Tue, Apr 22, 2008 at 4:19 PM, Liming Lian wrote: > Hi Kubo, > > In stmt.c, a method definition is as > > rb_define_private_method(cOCIStmt, "__defiend?", oci8_stmt_defined_p, 1); > > Is here "__defiend?" a typo for "__defined?"? or is there any special meaning to define this method name? It is a typo of course. Thanks. From kubo at jiubao.org Sun Apr 27 01:10:23 2008 From: kubo at jiubao.org (KUBO Takehiro) Date: Sun, 27 Apr 2008 14:10:23 +0900 Subject: [ruby-oci8-devel] Support FAN in Ruby-OCI8 In-Reply-To: <47FF2128.8060300@oracle.com> References: <47622312.8070500@oracle.com> <873ats17pb.fsf@lilliput.jiubao.org> <47761299.3060306@oracle.com> <5d847bcd0712302102h43288ac5oe51d0ed1f0534db@mail.gmail.com> <47903B41.5030601@oracle.com> <5d847bcd0801172257w28d754fla41fff6242d0a2ef@mail.gmail.com> <47906414.1040904@oracle.com> <5d847bcd0801180151u1d6f787fqad5f937fde6c2e65@mail.gmail.com> <47947ADD.5050701@oracle.com> <47FF2128.8060300@oracle.com> Message-ID: <5d847bcd0804262210p377740d9xad2bddd2c6ba6fbe@mail.gmail.com> Hi, On Fri, Apr 11, 2008 at 5:28 PM, shiwei zhang 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 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. From christopher.jones at oracle.com Tue Apr 29 23:57:55 2008 From: christopher.jones at oracle.com (Christopher Jones) Date: Tue, 29 Apr 2008 20:57:55 -0700 Subject: [ruby-oci8-devel] Support FAN in Ruby-OCI8 In-Reply-To: <5d847bcd0804262210p377740d9xad2bddd2c6ba6fbe@mail.gmail.com> References: <47622312.8070500@oracle.com> <873ats17pb.fsf@lilliput.jiubao.org> <47761299.3060306@oracle.com> <5d847bcd0712302102h43288ac5oe51d0ed1f0534db@mail.gmail.com> <47903B41.5030601@oracle.com> <5d847bcd0801172257w28d754fla41fff6242d0a2ef@mail.gmail.com> <47906414.1040904@oracle.com> <5d847bcd0801180151u1d6f787fqad5f937fde6c2e65@mail.gmail.com> <47947ADD.5050701@oracle.com> <47FF2128.8060300@oracle.com> <5d847bcd0804262210p377740d9xad2bddd2c6ba6fbe@mail.gmail.com> Message-ID: <4817EE43.3060200@oracle.com> 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=1.269.2.16.2.38.2.15&view=markup 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 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 > 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 -- Christopher Jones, Oracle Email: christopher.jones at oracle.com Tel: +1 650 506 8630 Blog: http://blogs.oracle.com/opal/ Free PHP Book: http://tinyurl.com/f8jad Follow me: http://friendfeed.com/ghrd