You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Andrew Hole <an...@gmail.com> on 2008/01/11 11:32:20 UTC

Connection pooling

Hello!

The following configuration was not supposed to be created 5
connections at first get connection execution?
My application with the following configuration creates always a new
session in the database for each invocation,
which is not to take advantage of pooling. Why?

<Context  docBase="F:/TOMCAT_UPG1_VIEWER/mni_ehrviewer"
reloadable="true" path="upg1ehr" >

	<Resource name="ehr" auth="Container" type="oracle.jdbc.pool.OracleDataSource"
	factory="oracle.jdbc.pool.OracleDataSourceFactory"
	driverClassName="oracle.jdbc.OracleDriver"
	url="jdbc:oracle:thin:@server_name:1521:sid" user="user"
password="password" initialSize="5" maxActive="50" maxIdle="10"
minIdle="5" maxWait="-1" defaultAutoCommit="false"/>


	<Manager className="org.apache.catalina.session.StandardManager"
maxActiveSessions="-1" maxInactiveInterval="1800" pathname=""
processExpiresFrequency="6" />

</Context>


Thanks a lot

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connection pooling

Posted by Andrew Hole <an...@gmail.com>.
Every db execution creates a new session.
Each session dropped correctly after db execution.
Is it supposed I see 5 (new) connections to database after tomcat restart?

Thanks

On Jan 11, 2008 2:24 PM, Caldarale, Charles R
<Ch...@unisys.com> wrote:
> > From: Andrew Hole [mailto:andremailinglist@gmail.com]
> > Subject: Connection pooling
> >
> > The following configuration was not supposed to be created 5
> > connections at first get connection execution?
>
> Not quite sure how to parse the above sentence, but the config should
> have created five connections at initialization.
>
> > My application with the following configuration creates
> > always a new session in the database for each invocation,
> > which is not to take advantage of pooling.
>
> Possibly because your webapp is not closing the connections, thereby not
> allowing them to return to the pool:
> http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.h
> tml#Preventing%20dB%20connection%20pool%20leaks
>
>  - Chuck
>
>
> THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
> MATERIAL and is thus for use only by the intended recipient. If you
> received this in error, please contact the sender and delete the e-mail
> and its attachments from all computers.
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Connection pooling

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Andrew Hole [mailto:andremailinglist@gmail.com] 
> Subject: Connection pooling
> 
> The following configuration was not supposed to be created 5
> connections at first get connection execution?

Not quite sure how to parse the above sentence, but the config should
have created five connections at initialization.

> My application with the following configuration creates 
> always a new session in the database for each invocation,
> which is not to take advantage of pooling.

Possibly because your webapp is not closing the connections, thereby not
allowing them to return to the pool:
http://tomcat.apache.org/tomcat-6.0-doc/jndi-datasource-examples-howto.h
tml#Preventing%20dB%20connection%20pool%20leaks

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


RE: Connection pooling

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Andrew Hole [mailto:andremailinglist@gmail.com] 
> Subject: Re: Connection pooling
> 
> With the following configuration i get the
> error:DatasourceConnectionProvider - Could not find datasource:
> java:/comp/env/ehr
> <Resource name="jdbc/ehr" auth="Container"

That's because Martin gave you bad information.  As long as the names
are consistent (which they were, before you applied Martin's
suggestion), it doesn't really matter what they are.  If you change the
<Resource> name to "jdbc/ehr" then the name on the context lookup in
your webapp must change correspondingly.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connection pooling

Posted by Andrew Hole <an...@gmail.com>.
Hi! Thanks...

With the following configuration i get the
error:DatasourceConnectionProvider - Could not find datasource:
java:/comp/env/ehr
<Resource name="jdbc/ehr" auth="Container"
type="oracle.jdbc.pool.OracleDataSource"
	factory="oracle.jdbc.pool.OracleDataSourceFactory"
	driverClassName="oracle.jdbc.OracleDriver"
	url="jdbc:oracle:thin:@192.168.1.244:1521:MIGRA03"
user="alert_viewer" password="alert" initialLimit="5" minLimit="5"
maxLimit="10" debug="5" />

With Resoruce name = "ehr"  works fine but  pooling is disable. I
don't know if paramenters initalLimit, minLimit are defined correctly.
Could you help me to setup a correct configuration?
I want have 5 initial database sessions.

<Resource name="ehr" auth="Container" type="oracle.jdbc.pool.OracleDataSource"
	factory="oracle.jdbc.pool.OracleDataSourceFactory"
	driverClassName="oracle.jdbc.OracleDriver"
	url="jdbc:oracle:thin:@192.168.1.244:1521:MIGRA03"
user="alert_viewer" password="alert" initialLimit="5" minLimit="5"
maxLimit="10" debug="5" />

Thanks a lot

On Jan 11, 2008 2:10 PM, Martin Gainty <mg...@hotmail.com> wrote:
> Andrew-
>
> The first thing I noticed is your Resource name shoule be "jdbc/ehr"
> replace server_name with the actual server name
> replace the SID with the Service ID you will be using (check the
> tnsnames.ora for SID)
> http://www.microdeveloper.com/html/JNDI_Orcl_Tomcat1p.html
>
> Martin
>
> ----- Original Message -----
> From: "Andrew Hole" <an...@gmail.com>
> To: "Tomcat Users List" <us...@tomcat.apache.org>
> Sent: Friday, January 11, 2008 5:32 AM
> Subject: Connection pooling
>
>
> > Hello!
> >
> > The following configuration was not supposed to be created 5
> > connections at first get connection execution?
> > My application with the following configuration creates always a new
> > session in the database for each invocation,
> > which is not to take advantage of pooling. Why?
> >
> > <Context  docBase="F:/TOMCAT_UPG1_VIEWER/mni_ehrviewer"
> > reloadable="true" path="upg1ehr" >
> >
> > <Resource name="ehr" auth="Container"
> type="oracle.jdbc.pool.OracleDataSource"
> > factory="oracle.jdbc.pool.OracleDataSourceFactory"
> > driverClassName="oracle.jdbc.OracleDriver"
> > url="jdbc:oracle:thin:@server_name:1521:sid" user="user"
> > password="password" initialSize="5" maxActive="50" maxIdle="10"
> > minIdle="5" maxWait="-1" defaultAutoCommit="false"/>
> >
> >
> > <Manager className="org.apache.catalina.session.StandardManager"
> > maxActiveSessions="-1" maxInactiveInterval="1800" pathname=""
> > processExpiresFrequency="6" />
> >
> > </Context>
> >
> >
> > Thanks a lot
> >
> > ---------------------------------------------------------------------
> > To start a new topic, e-mail: users@tomcat.apache.org
> > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> > For additional commands, e-mail: users-help@tomcat.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: Connection pooling

Posted by Martin Gainty <mg...@hotmail.com>.
Andrew-

The first thing I noticed is your Resource name shoule be "jdbc/ehr"
replace server_name with the actual server name
replace the SID with the Service ID you will be using (check the
tnsnames.ora for SID)
http://www.microdeveloper.com/html/JNDI_Orcl_Tomcat1p.html

Martin
----- Original Message -----
From: "Andrew Hole" <an...@gmail.com>
To: "Tomcat Users List" <us...@tomcat.apache.org>
Sent: Friday, January 11, 2008 5:32 AM
Subject: Connection pooling


> Hello!
>
> The following configuration was not supposed to be created 5
> connections at first get connection execution?
> My application with the following configuration creates always a new
> session in the database for each invocation,
> which is not to take advantage of pooling. Why?
>
> <Context  docBase="F:/TOMCAT_UPG1_VIEWER/mni_ehrviewer"
> reloadable="true" path="upg1ehr" >
>
> <Resource name="ehr" auth="Container"
type="oracle.jdbc.pool.OracleDataSource"
> factory="oracle.jdbc.pool.OracleDataSourceFactory"
> driverClassName="oracle.jdbc.OracleDriver"
> url="jdbc:oracle:thin:@server_name:1521:sid" user="user"
> password="password" initialSize="5" maxActive="50" maxIdle="10"
> minIdle="5" maxWait="-1" defaultAutoCommit="false"/>
>
>
> <Manager className="org.apache.catalina.session.StandardManager"
> maxActiveSessions="-1" maxInactiveInterval="1800" pathname=""
> processExpiresFrequency="6" />
>
> </Context>
>
>
> Thanks a lot
>
> ---------------------------------------------------------------------
> To start a new topic, e-mail: users@tomcat.apache.org
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>
>


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org