Re: Open connections

From: "Nico" <nicohmail-postgresql(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Open connections
Date: 2004-12-28 23:35:30
Message-ID: cqsqk0$2rji$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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" <pg(at)fastcrypt(dot)com> schreef in bericht news:41D16C5E(dot)8010800(at)fastcrypt(dot)com(dot)(dot)(dot)
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(at)fastcrypt(dot)com> schreef in bericht
news:41D15B20(dot)5000409(at)fastcrypt(dot)com(dot)(dot)(dot)
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(at)postgresql(dot)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(at)postgresql(dot)org)

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

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Rupa Schomaker 2004-12-29 04:46:56 Re: Open connections
Previous Message tony 2004-12-28 20:33:07 Re: openoffice and boolean