View Full Version : OC4j and abnormal exit of stm.executeQuery
Antonio
03-26-2004, 06:38 AM
Good Morning,
I've a Servlet with inside the doPost() method a connection to a dB,
the problem is that is a long query that work ok if launched on the dB
with something like TOAD and also works well on (JbuilderX + Tomcat)
environment but when deployed on OC4j it happens that during the
execution of
rs = stm.executeQuery(sSQL);
something appens and the result is that the execution go out of the
doPost() without passing for the catch() or the finally(), after this
the servlet is recharged again.
I can't not figure what is happening, could you help me ???
Thanks
Antonio D'Ottavio
P.S. : Here's the code :
ResultSet rs = null;
Statement stm = null;
Connection connR = null;
try {
sSQL = getSQLSelect();
Class.forName("oracle.jdbc.driver.OracleDriver");
connR = DriverManager.getConnection();
stm = connR.createStatement();
rs = stm.executeQuery(sSQL);
System.out.println("WebStampaRERO - after executeQuery" );
}
catch (Exception ex) {
System.out.println("WebStampaRERO - inside exception" );
ex.printStackTrace(System.out);
}
finally {
System.out.println("WebStampaRERO - dentro finally" );
if (rs != null) {
try {rs.close();} catch (Exception ex) {}
}
if (stm != null) {
try {stm.close();} catch (Exception ex) {}
}
if (connR != null) {
try { connR.close();} catch (Exception ex) {}
}
}
System.out.println("WebStampaRERO - dopo sendTemplate" );
}
Antonio
03-29-2004, 02:32 AM
Good Morning Joe
first of all thanks for your answer, in any case I've still not solved
this problem,
naturally the getConnection() include the right arguments and the
query is working on a time interval of 9 mounths while is not working
on a greater time interval, I've changed to Throwable ex as you
suggest but the execution do not enter there where that "something
strange" happens, I'm thinking that maybe the virtual machine crash or
something else, have you any idea else ???
Thanks
Antonio D'Ottavio
P.S. : Maybe there is some timeout on servlet in OC4J, I've used
httpSession.setMaxInactiveInterval(10000);
but with no result
"Joe Weinstein" <joeNOSPAM@bea.com> ha scritto nel messaggio
news:406460E5.4040604@bea.com... Antonio wrote: Good Morning, I've a Servlet with inside the doPost() method a connection to a dB, the problem is that is a long query that work ok if launched on the dB with something like TOAD and also works well on (JbuilderX + Tomcat) environment but when deployed on OC4j it happens that during the execution of rs = stm.executeQuery(sSQL); something appens and the result is that the execution go out of the doPost() without passing for the catch() or the finally(), after this the servlet is recharged again. I can't not figure what is happening, could you help me ??? Thanks Antonio D'Ottavio P.S. : Here's the code : ResultSet rs = null; Statement stm = null; Connection connR = null; try { sSQL = getSQLSelect(); Class.forName("oracle.jdbc.driver.OracleDriver"); connR = DriverManager.getConnection(); stm = connR.createStatement(); rs = stm.executeQuery(sSQL); System.out.println("WebStampaRERO - after executeQuery" ); } catch (Exception ex) { That's a mystery to me... If you print out a line just before the query, do you get it? I would change the catch (Exception to a catch (Throwable ex) to see if maybe you catch that... I do hope the real code is similar to this, but includes the right arguments to getConnection()... Joe Weinstein at BEA System.out.println("WebStampaRERO - inside exception" ); ex.printStackTrace(System.out); } finally { System.out.println("WebStampaRERO - dentro finally" ); if (rs != null) { try {rs.close();} catch (Exception ex) {} } if (stm != null) { try {stm.close();} catch (Exception ex) {} } if (connR != null) { try { connR.close();} catch (Exception ex) {} } } System.out.println("WebStampaRERO - dopo sendTemplate" ); }
Antonio
03-30-2004, 11:45 PM
Problem solved passing from OC4j 9.03 to OC4j 9.0.4 but please don't ask me why,
bye
Antonio
MyLounge.com Site Map
Forum:
Cars,
Cell Phone,
Database,
Games,
Home Improvement,
IT,
Music,
School,
Sports,
Web Design,
Web Server,
Weight Loss
The MyLounge.com forum is intended for informational use only and should not
be relied upon and is not a substitute for any advice. The information contained
on MyLounge.com are opinions and suggestions of members and is not a representation
of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for
the accuracy, completeness or usefulness of any postings or the qualifications
of any person responding. Please consult a expert or seek the services of an
attorney in your area for more accuracy on your specific situation. Please note
that our forums also serve as mirrors to Usenet newsgroups. Many posts you see
on our forums are made by newsgroup users who may not be members of MyLounge.com
Term of Service
vBulletin v3.0.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.