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 040DF3AC03B for ; Tue, 28 Dec 2004 23:35:52 +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 92827-06 for ; Tue, 28 Dec 2004 23:35:35 +0000 (GMT) Received: from floppy.pyrenet.fr (floppy.pyrenet.fr [194.250.190.2]) by svr1.postgresql.org (Postfix) with ESMTP id 39EEE3A6200 for ; Tue, 28 Dec 2004 23:35:34 +0000 (GMT) Received: by floppy.pyrenet.fr (Postfix, from userid 106) id DB294313EA; Wed, 29 Dec 2004 00:35:34 +0100 (MET) From: "Nico" X-Newsgroups: pgsql.interfaces.jdbc Subject: Re: Open connections Date: Wed, 29 Dec 2004 00:35:30 +0100 Organization: Hub.Org Networking Services Lines: 232 Message-ID: References: <41D15B20.5000409@fastcrypt.com> <41D16C5E.8010800@fastcrypt.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_012A_01C4ED3E.4CED4570" X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 To: pgsql-jdbc@postgresql.org X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=3.288 tagged_above=0 required=5 tests=AWL, FORGED_YAHOO_RCVD, HTML_30_40, HTML_MESSAGE, HTML_TITLE_EMPTY, PRIORITY_NO_NAME X-Spam-Level: *** X-Archive-Number: 200412/208 X-Sequence-Number: 11874 This is a multi-part message in MIME format. ------=_NextPart_000_012A_01C4ED3E.4CED4570 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable That's where the next problem lies: I don't know anything about pooling = mechanisms. Could you please give me a good place to get started? Or = some code how to do so? Thanks. "Dave Cramer" schreef in bericht = news:41D16C5E.8010800@fastcrypt.com... 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=20 Dave Nico wrote:=20 I forgot to mention one thing: I have no control over the server it's=20 running on. I only have permission for my account. It is imperative that = I=20 can have 4 open connections with my database, since my servlet generates = a=20 framesetpage where each frame of the three frames is that same servlet = with=20 other parameters to connect to the same database. Most of the time it's = not=20 a problem, but when I get 3 or more visitors at the same time, my=20 connections start to make trouble. Here is my website:=20 http://www.haegenssites.com/servlet/menus.DBMenuShow?dbname=3Dhaegens_vva= &menuid=3D311 "Dave Cramer" schreef in bericht=20 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=20 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=20 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 --=20 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 =20 ---------------------------(end of broadcast)--------------------------- TIP 2: you can get off all lists at once with the unregister command (send "unregister YourEmailAddressHere" to majordomo@postgresql.org) =20 --=20 Dave Cramer http://www.postgresintl.com 519 939 0336 ICQ#14675561 ------=_NextPart_000_012A_01C4ED3E.4CED4570 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
That's where the next problem lies: I = don't know=20 anything about pooling mechanisms. Could you please give me a good place = to get=20 started? Or some code how to do so?
Thanks.
"Dave Cramer" <pg@fastcrypt.com> schreef in = bericht news:41D16C5E.8010800@fastcr= ypt.com...
Nico,

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

Most of the time the = connection is=20 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=20 objects,  return connection and then display.

This can be = done=20 with each frame/servlet

Dave

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

"Dave Cramer" <pg@fastcrypt.com> schreef in =
bericht=20
news:41D15B20.5000409@fastcr=
ypt.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=20
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=20
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



      
--=20
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)


  

--=20
Dave Cramer
http://www.postgresintl.com
519 939 0336
ICQ#14675561
------=_NextPart_000_012A_01C4ED3E.4CED4570--