wood burning stoves 2.0*
The moose likes Websphere and the fly likes Webcontainer 80 % threads were waiting for database getconnection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "Webcontainer 80 % threads were waiting for database getconnection" Watch "Webcontainer 80 % threads were waiting for database getconnection" New topic
Author

Webcontainer 80 % threads were waiting for database getconnection

selva raja
Ranch Hand

Joined: Nov 24, 2009
Posts: 69
Dear all,

In websphere i got a below exception in during the peak load. My application running on the spring MVC. I have defined datasource connection pool size is 50 and time out setting is 180 sec...

I have reviewed the native_stdout.log file, the Object.wait() is showing 299 thread and percentage of usages is 80%.




what could be the cause for the above errors?
Is it related to application or websphere server?

Thanks,
selva
Anant Rao
Ranch Hand

Joined: Nov 12, 2004
Posts: 126
Can you verify if the database is up and running. You would get this error when the database is down.

Thanks
Anant
selva raja
Ranch Hand

Joined: Nov 24, 2009
Posts: 69
Thanks...YES.. database is working fine. The above errors occurs only during peak load.
selva raja
Ranch Hand

Joined: Nov 24, 2009
Posts: 69
PFA of connection pool setting for your ref.

Thanks,
selva


[Thumbnail for connectionpool.JPG]

Brian Hennessy
Ranch Hand

Joined: Oct 24, 2005
Posts: 57
Hi Selva
I would look at a couple of things.
Try identify if you have SQL calls taking longer than your connection wait timeout. If you have 50 connections all executing SQL and each piece of SQL takes 3 minutes to execute you could get this problem.

If its not the database then it could be a call to an integration point thats wrapped in the same transactional call as the db call.
For example

void callQuote() {
start transaction
call really_fast_sql
call http_service
end transaction
}

Note: start and end transaction probably handled by Spring AOP

if the call to call http_service blocks waiting on a response , the connection that is used to make the SQL call will not be released to the connection pool until the whole method ends.
Maybe the external system you call experiences problems at your peak load and its not in the database.

You fix this by removing the remote call from the transaction


Perform a thread dump and see whats executing and what else is waiting[and look at code].
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Webcontainer 80 % threads were waiting for database getconnection
 
Similar Threads
Correct JDBC Driver for Sybase 12.x in Websphere 6.1
JMS Connection Timeout Exception
ConnectionWaitTimeoutException.........
javax.mail.MessagingException is thrown when sending mail
Exception on Websphere/ Jdbc