From: KUBO Takehiro Date: 2003-07-02T13:03:12+09:00 Subject: Re: DBD::Oracle9 and non-blocking mode Brian Candler writes: > On Wed, Jul 02, 2003 at 01:04:00AM +0900, Jim Cain wrote: >> I'm about ready to make available an early copy of my library, but first >> I have some questions regarding non-blocking mode. I've never actually >> used this feature, so I'd like to hear from those that do how they use >> it. Do you need more support for it beyond simply setting/resetting the >> mode? What is the most convenient way for you to be notified that an OCI >> call is still executing? When a call is still running, would you like to >> call Statement#execute again to see if it's finished, or would you like >> some other method? > > I have used it briefly: setting non-blocking mode on Takehiro's ruby-oci8 > library, I was able to get several threads to run concurrent slow Oracle > queries. It didn't need any special support for notification; I just let > each thread block until its particular query had finished. (ruby-oci8 deals > with this by polling the OCI library at increasing intervals until OCI says > the query has completed, and then fetches the results) I implemented it in the ruby layer. In the next release I do it in the C API layer. See the macro oci_rc2 in the following URL. http://www.jiubao.org/ruby-oci8/ruby-oci8-v0.2-unusable-2003-0626/oci8.h Its license is same with ruby. So you can freely use its code fragment in your library or application. > However, I wasn't particularly happy with this approach, so in the end I > changed my application to run as multiple processes (in fact running under > FastCGI, so Apache controls the number of processes which are spawned), each > of which is a single thread so I don't care if OCI blocks. Hmm. What approach you prefer? -- KUBO Takehiro