aspose file tools*
The moose likes JDBC and the fly likes Connection Problem in Linux Server Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Connection Problem in Linux Server" Watch "Connection Problem in Linux Server" New topic
Author

Connection Problem in Linux Server

Manikandan Rajmohan
Greenhorn

Joined: Apr 12, 2010
Posts: 5
I am working in webportal using Java,Mysql. I am facing below issue. I cant able to resolve the issue. Daily i am restart the server then this issue is not coming... how to resolve this issue. without restart the server....

Error
====
org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1


Only when Google doesn't solve your problem, post your DBCP configuration file.


[LEARNING bLOG] | [Freelance Web Designer] | [and "Rohan" is part of my surname]
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2500
    
    8

This might be caused by connection leaks in your code. This happens when you do not close each connection you get from the pool.


OCUP UML fundamental and ITIL foundation
youtube channel
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Jan Cumps wrote:This happens when you do not close each connection you get from the pool.

Are you sure ? For me the error explains something like user set the number of connection to very less or the maxIdle or maxActive set to zero, which cause the application out of connection when he needs one.
Jan Cumps
Bartender

Joined: Dec 20, 2006
Posts: 2500
    
    8

I am not sure. I am almost never sure . I based my advise on the fact that the OP says that a nightly restart is a workaround for the problem.
Sagar Rohankar
Ranch Hand

Joined: Feb 19, 2008
Posts: 2902
    
    1

Jan Cumps wrote: I based my advise on the fact that the OP says that a nightly restart is a workaround for the problem.

Yep, that's also might be the case. So the bottom line is there are more than one reason for pool out of connection
Edison Gualberto
Greenhorn

Joined: Nov 05, 2008
Posts: 5
I'm not sure what the problem is here. But I think your web server is overwhelmed by the amount of load (the mysql connections) given to it. Here's a solution, close all of your mysql connections after use. Do not set mysql connection scope to "session".

Another solution is to speed up your web server. [link removed]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Connection Problem in Linux Server