[Zope] dynamic database connection

Jim Penny jpenny at universal-fasteners.com
Wed Jun 2 10:47:23 EDT 2004


On Wed, 2 Jun 2004 10:42:58 +0530
"Kailashnath_Ganesan" <Kailashnath_Ganesan at infosys.com> wrote:

> Hi,
> I am using mxODBC to connect to sql server 2000. I need to create a
> dynamic connection based on dsn,username and password given by the
> user.
>  
> All my zsql methods should use this connection. Advise on the same.
>  
> Thanks in advance.
> Kailashnath.
> 

You will have to either redesign your application, or write your own
connection method.  The problems are caching and startup time, zodb
connections sit idle but connected for their lifetime.  Then, when a
request comes in, an available connection is selected and used.  If you
were to create a connection pool per user, you would have an enormous
number of connections - and, as http is stateless, you would also have
to have a policy on when to shut down connections.  And it would be
slow.

Most people end up using a single DSN, and recording the user that
created/modified the row.

Jim Penny



More information about the Zope mailing list