Skip to Main Content

Java Database Connectivity (JDBC)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

JDBC: SQLException: Object has been closed. Error

843859Aug 2 2007 — edited Aug 3 2007
I have been struggling with this issue for a week now. The error I receive comes up sporadically. But recenetly it has been coming up consistently everytime I run the application with large data sets.

The application works fine for smaller datasets. The stored procedure I call works fine, but takes about 2 minutes to run in SQL Query Anazyzer.


I am running JRUN 4 SP1a. I have the newest drivers I can find on Adobe's site: macromedia_drivers.jar dated 10/4/2005. The database is MS SQL Server 2000

Does anyone have any ideas how to resolve.

Thank you.



.sql.SQLException: [Macromedia][SQLServer JDBC Driver]Object has been closed.
	at macromedia.jdbc.base.BaseExceptions.createException(Unknown Source)
	at macromedia.jdbc.base.BaseExceptions.getException(Unknown Source)
	at macromedia.jdbc.base.BaseResultSet.getString(Unknown Source)
	at macromedia.jdbc.base.BaseResultSet.getString(Unknown Source)
	at com.pg.logistics.report.TruckGeneration.doGet(TruckGeneration.java:410)
	at com.pg.logistics.report.TruckGeneration.doPost(TruckGeneration.java:603)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
	at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
	at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
	at jrun.servlet.JRunRequestDispatcher.invoke(JRunRequestDispatcher.java:252)
	at jrun.servlet.ServletEngineService.dispatch(ServletEngineService.java:527)
	at jrun.servlet.http.WebService.invokeRunnable(WebService.java:168)
	at jrunx.scheduler.ThreadPool$DownstreamMetrics.invokeRunnable(ThreadPool.java:348)
	at jrunx.scheduler.ThreadPool$ThreadThrottle.invokeRunnable(ThreadPool.java:451)
	at jrunx.scheduler.ThreadPool$UpstreamMetrics.invokeRunnable(ThreadPool.java:294)
	at jrunx.scheduler.WorkerThread.run(WorkerThread.java:66)
try{
		ResultSet rs = null;
		Connection conn = null;
		CallableStatement proc = null;
		//pass values to stored procedure
		conn = ds.getConnection();
		proc = conn.prepareCall("{ call MW_proc_Reports_TruckGeneration4( ?,?,?,?) }");
		proc.setInt(1, batchId);
		proc.setDouble(2, dWeightMax);
		proc.setDouble(3, dCOFMax);
		proc.setDouble(4, dFloorPosMax);
		proc.execute();
		rs = proc.getResultSet();
						
		rs = proc.getResultSet();
								
		fetch = rs.getFetchSize();
		while (rs.next())
		{
		//store in vector
		TruckGenerationItem item = new TruckGenerationItem();
		iRowCount = iRowCount + 1;
		item.setRecNum(iRowCount);
		item.setItemNumber(rs.getString("ItemNumber"));    //Exception is thrown here
		//get ResultSet data......
				reportItems.add(item);
			}
			numOfRecords = iRowCount;
			userSession.setAttribute("reportClass", reportItems);
		}
		if (rs != null)
		{
			rs.close();
			rs = null;
		}
		if (proc != null)
		{
			proc.close();
			proc = null;
		}
		if (conn != null)
		{
			conn.close();
			conn = null;
		}
							
					catch(Exception e)
{
//catch exception
}
Message was edited by:
mwolff

Message was edited by:
mwolff

Message was edited by:
mwolff

Message was edited by:
mwolff
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 31 2007
Added on Aug 2 2007
5 comments
6,177 views