Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Zope: DB

opening and closing a database connection from a dtml-method

 

 

Zope db RSS feed   Index | Next | Previous | View Threaded


Thomas_Janke at prisma-edv

Sep 19, 2001, 4:01 AM

Post #1 of 4 (764 views)
Permalink
opening and closing a database connection from a dtml-method

Hi,

I would like to know how to open and close a connection say, with a
mouse-click on a dynamic web-page E.g., in a form.

Thanks


matt at zope

Sep 19, 2001, 6:27 AM

Post #2 of 4 (717 views)
Permalink
Re: opening and closing a database connection from a dtml-method [In reply to]

Thomas_Janke [at] prisma-edv wrote:

>
>
>Hi,
>
>I would like to know how to open and close a connection say, with a
>mouse-click on a dynamic web-page E.g., in a form.
>
>Thanks
>
This is actually a lot trickier than you might think with Zope. The
reason is that Zope's RDBMS support does not have an "administrativly
closed" state on connections -- each time a connection is needed, it
will be opened if it is not already open. So, if you acquire a
connection object (e.g. by name) and replace its connection string with
an invalid one, you'll "close" the connection -- but that's not really
what you want, I dont think.


Thomas_Janke at prisma-edv

Sep 19, 2001, 11:13 PM

Post #3 of 4 (733 views)
Permalink
Re: opening and closing a database connection from a dtml-method [In reply to]

-----------
This is actually a lot trickier than you might think with Zope. The
reason is that Zope's RDBMS support does not have an "administrativly
closed" state on connections -- each time a connection is needed, it
will be opened if it is not already open. So, if you acquire a
connection object (e.g. by name) and replace its connection string with
an invalid one, you'll "close" the connection -- but that's not really
what you want, I dont think.
----------

How exactly do I replace a connections connection string?

Yours


matt at zope

Sep 20, 2001, 8:11 AM

Post #4 of 4 (731 views)
Permalink
Re: opening and closing a database connection from a dtml-method [In reply to]

Thomas_Janke [at] prisma-edv wrote:

>
>
>-----------
>This is actually a lot trickier than you might think with Zope. The
>reason is that Zope's RDBMS support does not have an "administrativly
>closed" state on connections -- each time a connection is needed, it
>will be opened if it is not already open. So, if you acquire a
>connection object (e.g. by name) and replace its connection string with
>an invalid one, you'll "close" the connection -- but that's not really
>what you want, I dont think.
>----------
>
>How exactly do I replace a connections connection string?
>
>Yours
>
Well, it COULD be as simple as grabbing the connection object and
changing its connection_string attribute, but that is going to vary by
DA as to what it's called -- i.e. there is no API for doing this.

>

Zope db RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.