(RADIATOR) Use of Oracle in PostAuthHook?

Matthew Trout MatthewTrout at businessserve.co.uk
Wed Jul 9 11:54:22 CDT 2003


Or (from the perl documentation for DBI)

     "connect_cached" NEW
           $dbh = DBI->connect_cached($data_source, $username, $password)
                     or die $DBI::errstr;
           $dbh = DBI->connect_cached($data_source, $username, $password,
\%attr)
                     or die $DBI::errstr;

         "connect_cached" is like "connect", except that the
         database handle returned is also stored in a hash
         associated with the given parameters. If another call is
         made to "connect_cached" with the same parameter values,
         then the corresponding cached $dbh will be returned if
         it is still valid.  The cached database handle is
         replaced with a new connection if it has been
         disconnected or if the "ping" method fails.

         Note that the behavior of this method differs in several
         respects from the behavior of presistent connections
         implemented by Apache::DBI.

         Caching can be useful in some applications, but it can
         also cause problems and should be used with care. The
         exact behavior of this method is liable to change, so if
         you intend to use it in any production applications you
         should discuss your needs on the dbi-users mailing list.

         The cache can be accessed (and cleared) via the
         "CachedKids" attribute.

will give you a persistent connection without any noticeable hassle

> -----Original Message-----
> From: John McFadden [mailto:dasjlm at uwo.ca] 
> Sent: 09 July 2003 16:47
> To: radiator at open.com.au
> Subject: (RADIATOR) Use of Oracle in PostAuthHook?
> 
> 
> We use LDAP to do the basic userid/password authentication 
> but intend to 
> use one or more Oracle databases
> to apply business rules as LDAP is not dynamic enough.
> 
> The PostAuthHook gives us a place to do that but I'm not sure if I 
> should try to do it within Radiator or
> via an external program call.
> 
> I'm a bit nervious about the Radiator/Perl SQL overhead.  
> 
> Does the PostAuthHook require a new connection for each 
> request or for 
> each session or each user?
> Or can I open the connection in a StartupHook (global var) then just 
> share it in the PostAuthHook to do the required SQL query.
> Since we're just doing queries I'm hoping to share one connection to 
> minimize overhead.   Any issues with concurrency if we do?
> 
> How do I detect the database is down and attempt to allocate a new 
> connection?
> 
> Comments, suggestions?
> 
> Regards JLM
> 
> 
> 
> 
> 
> 
> 
> 
> ===
> Archive at http://www.open.com.au/archives/radiator/
> Announcements on radiator-announce at open.com.au
> To unsubscribe, email 'majordomo at open.com.au' with
> 'unsubscribe radiator' in the body of the message.
> 
===
Archive at http://www.open.com.au/archives/radiator/
Announcements on radiator-announce at open.com.au
To unsubscribe, email 'majordomo at open.com.au' with
'unsubscribe radiator' in the body of the message.


More information about the radiator mailing list