[opencms-dev] connection pooling
Cyrill Brunschwiler
c.brunschwiler at bluewin.ch
Fri May 9 17:30:02 CEST 2003
Hi Tobias
I adapted the opencms db pooling for a little project.
Mainly the dbpool holds some connections.
The min and max amount of connections is configurable in
the properties. Also the maximum age and a timeout is configurable.
What you did until yet is getting the driver, setting up a connection
and executing some statements.
In bigger environments you'll run in troubles. maybe if you try to open
more connections than the db can handle.
Working with the pool:
Get the connection from the dbpool. something like..
Connection con = DBPool.connect();
Do your stuff you did until yet. something like...
PreparedStatement ps = con.xy ...
At the end of your db request free the connection. it's like...
DBPool.putConnection(con);
If you don't free the connection, the pool will kill the connection
and create a new one. !!! Do not force this behavior. It's just
implemented to take care about lost connections and quickly hackers.
If you'd try to get a connection from the pool and the maximum amount
of connections is allready reached, i think the statement will run
into a waiting loop.
Have Fun
Cyrill
-----Original Message-----
From: opencms-dev-admin at opencms.org
[mailto:opencms-dev-admin at opencms.org]On Behalf Of Herbig, Tobias
Sent: Friday, May 09, 2003 16:49
To: opencms-dev at opencms.org
Subject: [opencms-dev] connection pooling
hi everybody,
my name is tobias, i'm new at openCMS and currently working to get a overview.
can somebody post me, where to find documentation on how to use the database connection pooling?
thanks, tobias
(please excuse my poor english ; - ( )
_____________________________________
PENTASYS
Gesellschaft fuer Informationstechnologie mbH
Rüdesheimerstr. 9
80686 Muenchen
Tel. 089/ 579 52-225
Fax. 089/ 579 52-399
http://www.pentasys.de
E-Mail:tobias.herbig at pentasys.de
______________________________________
_______________________________________________
This mail is send to you from the opencms-dev mailing list
To change your list options, or to unsubscribe from the list, please visit
http://mail.opencms.org/mailman/listinfo/opencms-dev
More information about the opencms-dev
mailing list