Hi,all:
After some hacking way work,I believe it is not the code's error,it is database
connection's problem.
In DatabaseReader.java,get blob stream in serialize(Response) like that:
byte[] buffer = new byte[8096];
int length = -1;
while ((length = is.read(buffer)) > -1) {
out.write(buffer, 0, length);
}
is.close();
out.flush();
1.I make the buffer big enough to cache the whole file like
byte[] buffer = new byte[8096000];
the first time it read the whole file into buffer,works fine.but the second time it
just can't,and the same wrong.
2.I print the exception in generate()
try {
Response response = ObjectModelHelper.getResponse(objectModel);
this.serialize(response);
} catch (IOException ioe) {
System.out.println(ioe.toString());
...
and the message is:
java.io.IOException: [DataDirect][Oracle JDBC Driver]Object has been closed.
and the recycle() run.
the same jdbc driver in otherplace doing the same thing is fine,so I guest it may be
database management,but I'm not sure is tomcat or cocoon.
WDYT?
Roy Huang