db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prajeesh Kumar <prajeesh.ku...@v2solutions.com>
Subject Re: Réf. : Re: Connection pooling
Date Tue, 28 Dec 2004 09:15:00 GMT
Hi Noel,

Yes I think that is the mistake what I've done. I'm initializing the 
Torque using a struts plugin when the application starts.
and I'm not using the Torque.shoutdown() any where . The problem may 
arise is I may need to re -write classes to incorporate the changes.

Thanks for ur reply


regards

Prajeesh




bernard.noel@vallourec.fr wrote:

>Hi Prajeesh
>
>You have to make a Torque.shutdown in your init class when the context is
>destroyed (see method contextDestroyed)
>
>public class InitTorque implements ServletContextListener {
>
>     public void contextDestroyed(ServletContextEvent e) {//Add this method
>!!!
>          Torque.shutdown();
>     }
>     public void contextInitialized(ServletContextEvent e) {
>          if (!Torque.isInit()) {
>               try{
>                    Torque.init(e.getServletContext().getRealPath(
>"/WEB-INF/Torque.properties"));
>               } catch (TorqueException e1) {
>                    ...
>               }
>          }
>     }
>}
>
>Hope this will help,
>
>Bernard NOËL
>
>
>
>                                                                                     
                                       
>                    Prajeesh Kumar                                                   
                                       
>                    <prajeesh.kumar@v2solu        Pour :  Apache Torque Users List
<torque-user@db.apache.org>               
>                    tions.com>                    cc :                            
                                          
>                                                  Objet :      Re: Connection pooling
                                       
>                    28/12/2004 09:54                                                 
                                       
>                    Veuillez répondre à                                            
                                         
>                    "Apache Torque Users                                             
                                       
>                    List"                                                            
                                       
>                                                                                     
                                       
>                                                                                     
                                       
>
>
>
>
>Hi Thomas,
>
>I'm not making connection manually . The torque is doing that . I'm
>facing the problem in Torque. The only step what I'm doing is
>initializing the Torque.properties in a coustructor using Torque.init()
>method . Thanks for ur reply
>
>regards
>
>Prajeesh
>
>
>
>Thomas Fischer wrote:
>
>  
>
>>Hi,
>>
>>you have to close the connection yourself. Try connection.close() in a
>>finally block:
>>
>>java.sql.Connection connection = null;
>>try {
>> ... whatever you do to get the connection
>> ... whatever you do with the connection
>>}
>>finally {
>> if (connection != null) {
>>   try {
>>     connection.close();
>>   }
>>   catch(Exception e) {}
>> }
>>}
>>
>>
>>  Thomas
>>
>>Prajeesh Kumar <prajeesh.kumar@v2solutions.com> schrieb am 28.12.2004
>>08:16:07:
>>
>>
>>
>>    
>>
>>>Hello all ,
>>>
>>>Currently i'm working on Torque 3.1 and I've configured a DHCP
>>>connection to Postgresql database server running on linux. But the
>>>connection opened by the TOmcat webserver , is not getting closed. What
>>>shall i do? pleaze advice me .
>>>How can I simply implement conection pooling in torque?
>>>
>>>best regards
>>>
>>>--
>>>Prajeesh Kumar MS
>>>V2Solutions
>>>A New Vision to Solutions
>>>India: +91-22-56733201 ext. 218
>>>US : 1-408-705-2141  ext. 218
>>>http://www.v2solutions.com
>>>TZ:GMT+5.30
>>>
>>>
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>>>For additional commands, e-mail: torque-user-help@db.apache.org
>>>
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>>For additional commands, e-mail: torque-user-help@db.apache.org
>>
>>
>>
>>
>>
>>
>>    
>>
>
>
>--
>Prajeesh Kumar MS
>V2Solutions
>A New Vision to Solutions
>India: +91-22-56733201 ext. 218
>US : 1-408-705-2141  ext. 218
>http://www.v2solutions.com
>TZ:GMT+5.30
>
>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
>For additional commands, e-mail: torque-user-help@db.apache.org
>
>
>
>
>  
>


-- 
Prajeesh Kumar MS
V2Solutions
A New Vision to Solutions
India: +91-22-56733201 ext. 218
US : 1-408-705-2141  ext. 218
http://www.v2solutions.com 
TZ:GMT+5.30  


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message