Arawn
asked on
PostGresql - non superuser connection limit exceeded
I am running a JSP application on Tomcat that refreshes every minute. When it refreshes, it opens a connection to the DB, executes a few queries/updates, and then closes all the connections. I have similar pages in my app that do similar things.
One page though consistently blows up after about 20 minutes. It gives me a Fatal exception that says the "non superuser connection limit is exceeded". I have tried to figure out what is going wrong, especially since I know that I am closing the connections each time, and I know it is specific to PostGresql because the same pages run fine with an MS SQL db in the backend.
Does anybody have any ideas? I have checked the Postgresql site and there was nothing really helpful there that I could find.
One page though consistently blows up after about 20 minutes. It gives me a Fatal exception that says the "non superuser connection limit is exceeded". I have tried to figure out what is going wrong, especially since I know that I am closing the connections each time, and I know it is specific to PostGresql because the same pages run fine with an MS SQL db in the backend.
Does anybody have any ideas? I have checked the Postgresql site and there was nothing really helpful there that I could find.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It ended up being a problem on the host's side. Thanks for answering.
ASKER
I don't think I am using the superuser account, because this is actually a hosted database. And I can't see any hosting company giving away the superuser password.
The pertinent info from the page is below. I have truncated a whole bunch of things that aren't important. The main thing is that it is clear that the page is refreshing, and that the connection is being closed.
<%
response.setHeader("Cache-
response.setHeader("Pragma
response.setIntHeader("Ref
String sql="select aucID from auctionAuctions where aucEnded=0 and aucCloseDate<'"+currSQLDat
java.util.ArrayList openAuctions=new java.util.ArrayList();
Class.forName(jdbc_driver)
Connection con = DriverManager.getConnectio
Statement stmt = con.createStatement();
ResultSet rs=stmt.executeQuery(sql);
while(rs.next()){
openAuctions.add(""+rs.get
}
for(int x=0; x<openAuctions.size(); x++){
sql="select auctionItems.itemTitle, auctionAuctions.aucCurrent
rs= stmt.executeQuery(sql);
if(rs.next()){
// do stuff
rs.close();
}
}
sql="update auctionAuctions set aucEnded=1 where aucCloseDate<'"+currSQLDat
stmt.executeUpdate(sql);
stmt.close();
con.close();
%>