X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 5EF063AC15D for ; Tue, 28 Dec 2004 14:24:33 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 61717-05 for ; Tue, 28 Dec 2004 14:24:17 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id A33EE3AC083 for ; Tue, 28 Dec 2004 14:23:30 +0000 (GMT) Received: (qmail 19987 invoked from network); 28 Dec 2004 14:23:06 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 28 Dec 2004 14:23:06 -0000 Message-ID: <41D16C5E.8010800@fastcrypt.com> Date: Tue, 28 Dec 2004 09:23:26 -0500 From: Dave Cramer Reply-To: pg@fastcrypt.com Organization: Postgres International User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Nico Cc: pgsql-jdbc@postgresql.org Subject: Re: Open connections References: <41D15B20.5000409@fastcrypt.com> In-Reply-To: Content-Type: multipart/alternative; boundary="------------000108060008050500050500" X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.054 tagged_above=0 required=5 tests=AWL, HTML_30_40, HTML_MESSAGE, HTML_TITLE_EMPTY X-Spam-Level: X-Archive-Number: 200412/199 X-Sequence-Number: 11865 This is a multi-part message in MIME format. --------------000108060008050500050500 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Nico, I would still share the connections using a pooling mechanism of some kind. If every visitor is going to require 3 connections to the database, you can never scale past a certain point anyway. Most of the time the connection is only required for a short period of time. ie request comes in, get the connection, get the result set, read the result set into beans, or objects, return connection and then display. This can be done with each frame/servlet Dave Nico wrote: >I forgot to mention one thing: I have no control over the server it's >running on. I only have permission for my account. It is imperative that I >can have 4 open connections with my database, since my servlet generates a >framesetpage where each frame of the three frames is that same servlet with >other parameters to connect to the same database. Most of the time it's not >a problem, but when I get 3 or more visitors at the same time, my >connections start to make trouble. Here is my website: >http://www.haegenssites.com/servlet/menus.DBMenuShow?dbname=haegens_vva&menuid=311 > >"Dave Cramer" schreef in bericht >news:41D15B20.5000409@fastcrypt.com... > > >>Nico, >> >>this is somewhat problematic, the only way to do this is to use the unix >>tool ps to determine the number of processes. >> >>A much better way to do this is to use a robust connection pool like dbcp >>from apache, which will manage your connections for you. >> >>Dave >> >>Nico wrote: >> >> >> >>>I would like to know how many connections are open at a certain time from >>>a servlet, so I can anticipate connection errors. How do I do that? >>> >>>Nico. >>> >>> >>>---------------------------(end of broadcast)--------------------------- >>>TIP 3: if posting/reading through Usenet, please send an appropriate >>> subscribe-nomail command to majordomo@postgresql.org so that your >>> message can get through to the mailing list cleanly >>> >>> >>> >>> >>> >>-- >>Dave Cramer >>http://www.postgresintl.com >>519 939 0336 >>ICQ#14675561 >> >> >>---------------------------(end of broadcast)--------------------------- >>TIP 6: Have you searched our list archives? >> >> http://archives.postgresql.org >> >> >> > > > >---------------------------(end of broadcast)--------------------------- >TIP 2: you can get off all lists at once with the unregister command > (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) > > > > -- Dave Cramer http://www.postgresintl.com 519 939 0336 ICQ#14675561 --------------000108060008050500050500 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Nico,

I would still share the connections using a pooling mechanism of some kind. If every visitor is going to require 3 connections to the database, you can never scale past a certain point anyway.

Most of the time the connection is only required for a short period of time. ie request comes in, get the connection, get the result set, read the result set into beans, or objects,  return connection and then display.

This can be done with each frame/servlet

Dave

Nico wrote:
I forgot to mention one thing: I have no control over the server it's 
running on. I only have permission for my account. It is imperative that I 
can have 4 open connections with my database, since my servlet generates a 
framesetpage where each frame of the three frames is that same servlet with 
other parameters to connect to the same database. Most of the time it's not 
a problem, but when I get 3 or more visitors at the same time, my 
connections start to make trouble. Here is my website: 
http://www.haegenssites.com/servlet/menus.DBMenuShow?dbname=haegens_vva&menuid=311

"Dave Cramer" <pg@fastcrypt.com> schreef in bericht 
news:41D15B20.5000409@fastcrypt.com...
  
Nico,

this is somewhat problematic, the only way to do this is to use the unix 
tool ps to determine the number of processes.

A much better way to do this is to use a robust connection pool like dbcp 
from apache, which will manage your connections for you.

Dave

Nico wrote:

    
I would like to know how many connections are open at a certain time from 
a servlet, so I can anticipate connection errors. How do I do that?

Nico.


---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
     subscribe-nomail command to majordomo@postgresql.org so that your
     message can get through to the mailing list cleanly



      
-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561


---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

              http://archives.postgresql.org

    



---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


  

-- 
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561
--------------000108060008050500050500--