[Koha-devel] about C4Connect

Pat Eyler pate at eylerfamily.org
Tue Jun 11 13:34:03 CEST 2002


On Tue, 11 Jun 2002, Alan Millar wrote:

> On Tue, Jun 11, 2002 at 09:16:53AM -0400, Nicholas Rosasco wrote:
> > > One solution (at least on the high end) is to use mod_perl and Apache::DBI
> > > to intercept the connect and disconnect calls and use an existing pool of
> > > connections instead.
> >
> > Careful:  mod_perl+apache leads to two things needing to be done....
> > (a) we sacrifice the (at least theoretical) ability to be truly
> > webserver-app-choice independent (Bigger question:  How important is that
> > independence)
>
> In my opinion, fairly important.  Even someone who commits to working with only
> one method of a solution, and "doesn't care" about being portable, eventually
> will find out that they've worked themselves into a corner when an upgraded
> and/or altered version of their one solution comes out and they have to retrofit.
>
> Abstraction is a Good Thing.
>
> I've never used mod_perl.  Is there a way we can be "mod_perl friendly"
> and still work just fine with the current CGI methods?

Yes, there is ...  it's using Apache::Registry to run the scripts (which
makes them rather like a plain CGI only faster.  It does however preload
the scripts into the Apache server -- so that we have to be more careful
when writing code (silly things like not closing filehandles or
having global variables all over the place) which a straight CGI script
won't flinch at will cause problems when run in the stricter environment
of Apache::Registry (using diagnostics and strict pragmas will get you 99%
of the way to mod_perl safety).

Using Apache::DBI is something that we can do without changing the
scripts (accept as noted above).  It will intercept the DBI connect and
disonnects and replace them with connections to a pool of existing
connections.

>
> Perhaps the abstraction can take place within C4Connect, which could
> accomodate for the type of environment present.  I still think the handle
> should be passed to individual subroutines, though.

Even if we do decide to let bigger users go the Apache::DBI route
minimizing the number of connect/disconnect calls we use would be a good
thing.   I think passing a handle within a module makes a lot of sense.

-pate

>
> - Alan
>
> ----
> Alan Millar     --==> am12 at bolis.com <==--
>
> _______________________________________________________________
>
> Multimillion Dollar Computer Inventory
> Live Webcast Auctions Thru Aug. 2002 - http://www.cowanalexander.com/calendar
>
>
>
> _______________________________________________
> Koha-devel mailing list
> Koha-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/koha-devel
>





More information about the Koha-devel mailing list