When I init the request I need open a connection with the database (and execute a query for example) and in the end of the request I need close the database connection.
Another question is: How I know that a database connection is open ?
ps: sorry by my 'dummie questions' and by my terrible english !.
On Wednesday, September 19, 2012 3:54:12 PM UTC-4, ProfessionalIT wrote:
> How to implement this ?
> When I init the request I need open a connection with the database (and > execute a query for example) and in the end of the request I need close the > database connection.
Por que fechar a conexão?
Normally, for performance, you want to open the connection as soon as you get a chance and _keep_ it open. What problem are you trying to solve?
> Normally, for performance, you want to open the connection as soon as you > get a chance and _keep_ it open. What problem are you trying to solve?
> Tchau,
> Francois
> Francois,
Well, I think that when many visitants access the website (where each access is a new browser session and a new database connection correct ? ) this can leave the website slow.
Actually I still don't know how...I don't understand how the connections works in web.py, for example, I don't know when the connection is closed.
> To post to this group, send email to webpy@googlegroups.com.
> To unsubscribe from this group, send email to
> webpy+unsubscribe@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/webpy?hl=en.
Have you monitored your database to see how many connections does it has? I may be wrong, but I think db connections number aren't related to sessions number.
> On Fri, Sep 21, 2012 at 9:04 AM, ProfessionalIT <lsev...@gmail.com<javascript:>> > wrote: > > Friends,
> > Any idea ?, tip ? or suggestion ?
> > -- > > You received this message because you are subscribed to the Google > Groups > > "web.py" group. > > To view this discussion on the web visit > > https://groups.google.com/d/msg/webpy/-/WgK-kI1cAEQJ.
> > To post to this group, send email to we...@googlegroups.com<javascript:>.
> > To unsubscribe from this group, send email to > > webpy+un...@googlegroups.com <javascript:>. > > For more options, visit this group at > > http://groups.google.com/group/webpy?hl=en.