David,
Ignore the previous code!!This is the right one:will this code make the
difference?

catch(Exception exp)
            {
                  theLog.error("Exception while getting  a Datasource
connection..Trying again...");
                  theLog.error(exp);
                  int i=1;
                  do{
                        try{
                              return ds.getConnection();
                        }
                        catch(Exception e){

                              theLog.error("Try:"+i+"Exception while
getting  a Datasource connection...");
                              theLog.error(e);
                              if(i==3)
                            throw e;

                        }
                        i++
                  }while(i<=3)

            }

Regards,
Thangavel Sankaranarayanan




                                                                           
             Thangavel                                                     
             Sankaranarayanan/                                             
             India/[EMAIL PROTECTED]                                            
To 
                                       "Tomcat Users List"                 
             09/09/2008 12:16          <users@tomcat.apache.org>           
             AM                                                         cc 
                                                                           
                                                                   Subject 
             Please respond to         Re: Intermitant DB Problem in       
               "Tomcat Users           tomcat:java.sql.SQLException: Io    
                   List"               exception: Connection reset by      
             <[EMAIL PROTECTED]         peer: JVM_recv in socket input      
                 che.org>              stream read                         
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           
                                                                           




David,Actually Resource element is used when we want to map a datascr to a
JNDI Resource and call from aoos.But in my case there is no JNDI naming of
datasource or database!!
all parameters are hard coded .
In that case wat can i do!!!
I have modified my code slightly to look like ths!!! will this be
helpfull???

catch(Exception exp)
            {
                  theLog.error("Exception while getting  a Datasource
connection..Trying again...");
                  theLog.error(exp);
                  int i=1;
                  do{
                        try{
                              return ds.getConnection();
                        }
                        catch(Exception e){

                              theLog.error("Try:"+i+"Exception while
getting  a Datasource connection...");
                              theLog.error(e);
                              if(i==3)
                            throw e;

                        }
                        i++
                  }while(i<=3)

            }



Regards,
Thangavel Sankaranarayanan




             David Smith
             <[EMAIL PROTECTED]
             >                                                          To
                                       Tomcat Users List
             09/08/2008 11:51          <users@tomcat.apache.org>
             PM                                                         cc

                                                                   Subject
             Please respond to         Re: Intermitant DB Problem in
               "Tomcat Users           tomcat:java.sql.SQLException: Io
                   List"               exception: Connection reset by
             <[EMAIL PROTECTED]         peer: JVM_recv in socket input
                 che.org>              stream read










Actually I believe tomcat 4.1 still predominantly used server.xml for
context definitions.  Take a look in there for a <ResourceParams ...>
... </ResourceParams> element under your webapp's <Context ...>  ...
</Context> element.  I could be wrong about that -- it's been a *very*
long time since I've done anything with that version.

--David

Thangavel Sankaranarayanan wrote:
> Hi David,
>
> In my webapps directory ,i can find Conext.xml (nameof context.xml).in my
> context.xml the following is defined..
>
> where do i need to configure it ,David??
>
> <Context path="/mpp" docBase="D:/projects/mpp/dealer/release071010"
> debug="0" privileged="true">
>
>       <Realm className="au.com.workconsult.catalina.realm.NdsJNDIRealm"
> debug="99"
>              connectionName="cn=Directory Manager"
>              connectionPassword="hadepyhkl"
>        connectionURL="ldap://vanja1234:389";
>        digest="SHA"
>        roleBase="ou=mpp,ou=Groups,dc=vodafone,dc=com,dc=au"
>              roleName="cn"
>              roleSearch="(uniquemember={0})"
>              roleSubtree="true"
>        userPassword="userPassword"
>        userPattern="uid={0},dc=abc,dc=com,dc=in"
>       />
>
> </Context>
>
>
>
> Regards,
> Thangavel Sankaranarayanan
>
>
>
>
>

>              David Smith

>              <[EMAIL PROTECTED]

>              >
To
>                                        Tomcat Users List

>              09/08/2008 10:44          <users@tomcat.apache.org>

>              PM
cc
>

>
Subject
>              Please respond to         Re: Intermitant DB Problem in

>                "Tomcat Users           tomcat:java.sql.SQLException: Io

>                    List"               exception: Connection reset by

>              <[EMAIL PROTECTED]         peer: JVM_recv in socket input

>                  che.org>              stream read

>

>

>

>

>

>

>
>
>
>
> I think so.  Tomcat 4.1.x relies on DBCP 1.0 whose docs aren't readily
> available anymore.  If you can find the source for DBCP 1.0, you could
> take a look in the source code and get that answer.  Or you could just
> try it on your test system and see if it works. :-)
>
> The manner the validation query is added to tomat's config is different
> though.  You add it in the ResourceParams element the same way other
> properties are defined in your version.
>
> --David
>
> Thangavel Sankaranarayanan wrote:
>
>
>> Hi David,
>> Thanks !!!
>>
>> Is the validationQuery applicable to tomacat 4.x.
>> I am using tomcat 4.x in windows2000
>>
>>
>> Regards,
>> Thangavel Sankaranarayanan
>>
>>
>>
>>
>>
>>
>
>
>>              David Smith
>>
>
>
>>              <[EMAIL PROTECTED]
>>
>
>
>>              >
>>
> To
>
>>                                        Tomcat Users List
>>
>
>
>>              09/08/2008 09:19          <users@tomcat.apache.org>
>>
>
>
>>              PM
>>
> cc
>
>
>
> Subject
>
>>              Please respond to         Re: Intermitant DB Problem in
>>
>
>
>>                "Tomcat Users           tomcat:java.sql.SQLException: Io
>>
>
>
>>                    List"               exception: Connection reset by
>>
>
>
>>              <[EMAIL PROTECTED]         peer: JVM_recv in socket input
>>
>
>
>>                  che.org>              stream read
>>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>>
>>
>> I've partially given it to you already.  I'm assuming for the purposes
>> of this thread you have tomcat 5.5.x or tomcat 6.0.x and are using the
>> tomcat provided database pooling.  Find the <Resource ... /> element in
>> your webapp's context xml file where you defined your database pool and
>> add an attribute named validationQuery with a value of "select 1".  Then
>> restart your webapp.
>>
>> --David
>>
>> Thangavel Sankaranarayanan wrote:
>>
>>
>>> Please help me in setting up a Validation Querry!!!
>>> I am not aware of it!!
>>>
>>> Regards,
>>> Thangavel Sankaranarayanan
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>>              David Smith
>>>
>>>
>>
>>>              <[EMAIL PROTECTED]
>>>
>>>
>>
>>>              >
>>>
>>>
>> To
>>
>>
>>>                                        Tomcat Users List
>>>
>>>
>>
>>>              09/08/2008 06:24          <users@tomcat.apache.org>
>>>
>>>
>>
>>>              PM
>>>
>>>
>> cc
>>
>>
>>
>> Subject
>>
>>
>>>              Please respond to         Re: Intermitant DB Problem in
>>>
>>>
>>
>>>                "Tomcat Users           tomcat:java.sql.SQLException: Io
>>>
>>>
>>
>>>                    List"               exception: Connection reset by
>>>
>>>
>>
>>>              <[EMAIL PROTECTED]         peer: JVM_recv in socket input
>>>
>>>
>>
>>>                  che.org>              stream read
>>>
>>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> Two questions:
>>>
>>> 1. Is the db server on the same box as the tomcat server?  If not, have
>>> you ruled out network hardware issues between the db server and tomcat?
>>>
>>> 2. Does your db pool definition have the attribute
>>> validationQuery="select 1"?  That would pre-test your connections
before
>>> returning one on ds.getConnection(), regenerating them if they fail.
>>>
>>> --David
>>>
>>> Thangavel Sankaranarayanan wrote:
>>>
>>>
>>>
>>>> Hi ,
>>>>
>>>> I am getting the following error when connecting to oracle database,
>>>>
>>>> Has any one seen this kind of errors before? is this the problem with
>>>> tomcat in loosing the connections??
>>>> I am getting  this error once in 5 hrs and i get a HTTPStatus500 error
>>>>
>>>>
>>>>
>>> and
>>>
>>>
>>>
>>>> when a user tries again it gets okay and it is working
>>>> How can i resolve this Intermitant DB Problem in tomcat!!!
>>>>
>>>> java.sql.SQLException: Io exception: Connection reset by peer:
JVM_recv
>>>>
>>>>
>>>>
>>> in
>>>
>>>
>>>
>>>> socket input stream read
>>>>
>>>> This is the Exception details in my application logs:
>>>>   DEBUG  au.com.vodafone.mpp.bos.MPPFactory  - Calling getConnection
>>>>
>>>>
>>>>
>>> method
>>>
>>>
>>>
>>>> of Datasrc Class:600991
>>>>   DEBUG  au.com.vodafone.mpp.da.DataSrc  - Inside getConnection()
>>>>
> method
>
>>>>
>>> of
>>>
>>>
>>>
>>>> DataScr
>>>>  DEBUG  au.com.vodafone.mpp.da.DataSrc  - About to get a Connection
>>>>
> from
>
>>>> SharedPoolDatasrc and return it back...
>>>>   ERROR  au.com.vodafone.mpp.da.DataSrc  - Exception while get a
>>>>
>>>>
>>>>
>>> Datasource
>>>
>>>
>>>
>>>> connection
>>>>  ERROR  au.com.vodafone.mpp.da.DataSrc  - java.sql.SQLException: Io
>>>> exception: Connection reset by peer: JVM_recv in socket input stream
>>>>
>>>>
>> read
>>
>>
>>>>  DEBUG  au.com.vodafone.mpp.bos.MPPFactory  -
>>>> Exception:java.sql.SQLException: Io exception: Connection reset by
>>>>
> peer:
>
>>>> JVM_recv in socket input stream read
>>>>  WARN   org.apache.struts.action.RequestProcessor  - Unhandled
>>>>
> Exception
>
>>>> thrown: class java.sql.SQLException
>>>>
>>>>
>>>> This is my code:
>>>>
>>>> static public Connection getConnection() throws Exception {
>>>>             theLog.debug("Inside getConnection() method of DataScr");
>>>>             try
>>>>             {
>>>>
>>>>                   if (ds == null)
>>>>                   {
>>>>                         theLog.debug("SharedPoolDatasrc is NULL:
>>>>
> Serious
>
>>>> Error ");
>>>>                         System.out.println("SERIOUS ERROR 99");
>>>>                   }
>>>>                   theLog.debug("About to get a Connection from
>>>> SharedPoolDatasrc and return it back...");
>>>>                   return ds.getConnection();
>>>>             }
>>>>             catch(Exception exp)
>>>>             {
>>>>                   theLog.error("Exception while get a Datasource
>>>> connection");
>>>>                   theLog.error(exp);
>>>>                   throw exp;
>>>>             }
>>>>       }
>>>>
>>>>
>>>>
>>>> Regards,
>>>> Thangavel Sankaranarayanan
>>>>
>>>>
>>>>


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




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




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

Reply via email to