File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Connection Problem in Linux Server

 
Manikandan Rajmohan
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2904
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Only when Google doesn't solve your problem, post your DBCP configuration file.
 
Jan Cumps
Bartender
Posts: 2576
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might be caused by connection leaks in your code. This happens when you do not close each connection you get from the pool.
 
Sagar Rohankar
Ranch Hand
Posts: 2904
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2576
11
C++ Linux Netbeans IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 2904
1
Java Spring Ubuntu
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic