Thanks : David Kerber and Chris

As you suggested that the issue is more likely belongs to database, you are
right, I have checked in my oracle that is there been any blocking session
are there?
And guess what, I have found blocked session and when I kill them manually,
the application execution resume.

Actually there is no hanging of tomcat service as such, because as I stated
before, when I kill my blocking session, all again running fine.

Now what I was thinking is how to avoid that blocking session from my
application code.
Currently, what I have done in my servlet programming till date is as
follows.
1) In doPost Method, I created or say get datasource object.
2) from doPost method I transfer my control to business logic method.
3) in my business logic method, I create connection object locally. In same
method I create my statement object
3) then close them all at the end of business logic method.(Using finally
block)

Now, Can you suggest me how I should use DBCP i.e. Creating DataSource
Object, Connection Object, Statement object.
Suggest me efficient way to use DBCP so that I can avoid blocking session in
my oracle

Thanks and Regards,

Milan Dalsaniya
BIPL

-----Original Message-----
From: David kerber [mailto:dcker...@verizon.net] 
Sent: Friday, December 27, 2013 5:39 PM
To: Tomcat Users List
Subject: Re: Apache Tomcat 5.0.28 Server/Intermittently Web Apps becomes
Unresponsive

On 12/27/2013 4:31 AM, Milan wrote:

> Hello to All,

...

(Lots of good information snipped)


> -          Each transaction, i.e. Data Insertion in both Database took
> around 3 to 5 seconds.
>
> -          We have used DBCP for Database connection.
>
> -          When data insertion took place we are using servlet for
> transaction to Database. So request raise from JSP to Servlet.
>
>
>
> Now the issue I am facing right now is in a middle of any transaction 
> to DB or say while user try to opening any form or try to load the 
> application in IE,
>
> He/she does not get any response in browser, the browser simply 
> display progress bar and keep on processing and then after fair enough 
> time(say 2 to
> 3 Minutes). Its stop processing page.

To me, this "feels" like an issue with the database or your app's
connections to it.  A few of possibilities come to mind:

    1.  there is a rogue query in your app that is taking a very long time
to return.

    2.  You are running out of db resources, such as connections or open
statements, and it is blocking other operations while waiting for resources
to be freed up.

    3.  A query or other db operation is blocking (due to record locks or
similar things) for a long time, and the users time out while waiting for
the block to be released.


So, to help isolate the problem, a few questions:

    1.  When this is happening, is it only this client who is affected, or
are others stopped as well?

    2.  What are the cpu and memory usage during the hang time?  8GB doesn't
seem like a lot of memory for SQL Server Enterprise when it's sharing a
machine with other services.

    3.  Is the memory usage pretty steady, or is it going up over time
before you get this hang?


>
>
>
> While I restart my Apache Tomcat 5.0.28 Service, the web apps start
> responding smoothly again as in normal state.
>
>
>
> The issue's frequency in one day is 3 to 4 time at any given time, say
> randomly. They called it "Hanging of Apache Tomcat", but I am not still
> fully sure what is actually happening.
>
>
>
> Following is my web app's context.
>
>
>
> <Resource name="jdbc/wipo" auth="Container" type="javax.sql.DataSource"/>
>
> <ResourceParams name="jdbc/wipo">
>
>
>
<parameter><name>factory</name><value>org.apache.commons.dbcp.BasicDataSourc
> eFactory</value></parameter>
>
>
>
<parameter><name>driverClassName</name><value>oracle.jdbc.driver.OracleDrive
> r</value></parameter>
>
>
>
<parameter><name>url</name><value>jdbc:oracle:thin:@IP:PORT:SID</value></par
> ameter>
>
>    <parameter><name>username</name><value>UNAME</value></parameter>
>
>    <parameter><name>password</name><value>PASS</value></parameter>
>
>    <parameter><name>maxActive</name><value>500</value></parameter>
>
>    <parameter><name>maxIdle</name><value>75</value></parameter>
>
>    <parameter><name>maxWait</name><value>10000</value></parameter>
>
>    <parameter><name>removeAbandoned</name><value>true</value></parameter>
>
>
>
<parameter><name>removeAbandonedTimeout</name><value>60</value></parameter>
>
>    <parameter><name>logAbandoned</name><value>true</value></parameter>
>
> </ResourceParams>
>
> <Resource name="jdbc/wips" auth="Container" type="javax.sql.DataSource"/>
>
>                  <ResourceParams name="jdbc/wips">
>
>
>
<parameter><name>url</name><value>jdbc:sqlserver://IP:PORT;forwardReadOnlyMe
> thod=serverCursor;loginTimeout=30;databaseName=dbname</value></parameter>
>
<parameter><name>driverClassName</name><value>com.microsoft.sqlserver.jdbc.S
> QLServerDriver</value></parameter>
>
>
> <parameter><name>username</name><value>UNAME</value></parameter>
>
>
> <parameter><name>password</name><value>PASS</value></parameter>
>
>
> <parameter><name>maxActive</name><value>500</value></parameter>
>
>
> <parameter><name>maxIdle</name><value>75</value></parameter>
>
>
> <parameter><name>maxWait</name><value>10000</value></parameter>
>
>
> <parameter><name>removeAbandoned</name><value>true</value></parameter>
>
>
>
<parameter><name>removeAbandonedTimeout</name><value>60</value></parameter>
>
>
> <parameter><name>logAbandoned</name><value>true</value></parameter>
>
>
>                  </ResourceParams>
>
>
>
>
>
> While this particular situation arises,  my tomcat service shows running.
>
> Please help me with this issued as I am able to resolve it.
>
>
>
> Manny Thanks.
>
>
>
> Thanks and Regards,
>
>
>
> Milan Dalsaniya
>
> BIPL
>
>
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to