tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Roberts, Eric" <Eric.Robe...@one.at>
Subject RE: Tomcat 4.0.x JDBC connection pooling
Date Fri, 17 Jan 2003 08:25:44 GMT
Yes - We used 4.1.12 and have just migrated to 4.1.18 on a mission critical 24 x 7 app and
we have had no problems - once we got it working in the first place!!

-----Original Message-----
From: Luca Cremonini [mailto:luca.cremonini@honyvem.it]
Sent: Donnerstag, 16. Jänner 2003 18:00
To: Tomcat Users List
Subject: RE: Tomcat 4.0.x JDBC connection pooling



Thanks Eric!

But with Tomcat 4.0.x I don't have things like MaxActive, MinIdle and other
parameters...
4.0 documentation doesn't tell anything about this.

It seems to me that I have to migrate to 4.1.x to use the pool and such
parameters.
Am I right?

L.C.



                                                                                         
                         
                    "Roberts,                                                            
                         
                    Eric"                Per:    "Tomcat Users List" <tomcat-user@jakarta.apache.org>
             
                    <Eric.Roberts@       Cc:                                          
                            
                    one.at>              Oggetto:     RE: Tomcat 4.0.x JDBC connection
pooling                     
                                                                                         
                         
                    16/01/2003                                                           
                         
                    17.33                                                                
                         
                    Per favore,                                                          
                         
                    rispondere a                                                         
                         
                    "Tomcat Users                                                        
                         
                    List"                                                                
                         
                                                                                         
                         
                                                                                         
                         




Hi Luca,

The pool is established in the definition of the resource jdbc/EmployeeDB -
where things like MaxActive, MinIdle and other parameters determine how the
pool behaves.

At startup the pool will connect the MinIdle connections to the DB - a new
connection will then only be established if that number are already in use.

It is good practice to always close connections, as otherwise you become
dependent on parameters like RemoveAbandoned and RemoveAbandoned timeout.

All of this is discussed in the JNDI Datasource HOWTO in the documention :
-)

-----Original Message-----
From: Luca Cremonini [mailto:luca.cremonini@honyvem.it]
Sent: Donnerstag, 16. Jänner 2003 17:17
To: tomcat-user@jakarta.apache.org
Subject: Tomcat 4.0.x JDBC connection pooling


I'm using JDBC connection with Tomcat 4.0 as shown in Tomcat4.0 online
documentation
(http://jakarta.apache.org/tomcat/tomcat-4.0-doc/jndi-resources-howto.html
):

-----------------------------------------------
// Obtain our environment naming context
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");

// Look up our data source
DataSource ds = (DataSource)
  envCtx.lookup("jdbc/EmployeeDB");

// Allocate and use a connection from the pool
Connection conn = ds.getConnection();

... use this connection to access the database ...

conn.close();
-----------------------------------------------

I searched the mailing list and the web,
but coudn't find answer to these questions:

- When I call

     ds.getConnection();

am I getting a connection from a pool or opening a NEW connection every
time?


- If there's a pool why do I have to close the connection with

     conn.close();

instead of releasing it to the pool?

- What are the improvement in Tomcat 1.1.x about JDBC connection pooling?


--
To unsubscribe, e-mail:   <
mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:tomcat-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <
mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <
mailto:tomcat-user-help@jakarta.apache.org>





--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message