Here's a little more information on the tag pooling problem we are having
with dbtags under Tomcat 4.1.12. I thought I'd try a work around that
avoided the statement and query tags altogether and just do them manually.
Now the second resultSet iterates and outputs all of the items from the
_first_ query. There really appears to be something wrong with the way
dbtags recycles it's state.
------------First Query returns rows-----------
<% String query2 = conn.getQuery("product.non.standard.options");
java.sql.Statement stmt2 = conn.createStatement();
java.sql.ResultSet rset2 = stmt2.executeQuery(query2);
pageContext.setAttribute("rset2", rset2);
%>
<sql:resultSet id="rset2b" name="rset2" scope="page">
<sql:getColumn colName="IndexedID"/>
</sql:resultSet>
<% rset2.close();
stmt2.close();
%>
----------Second Query returns NO rows-----------
<% String query3 = conn.getQuery("product.value.options");
java.sql.Statement stmt3 = conn.createStatement();
java.sql.ResultSet rset3 = stmt3.executeQuery(query3);
pageContext.setAttribute("rset3", rset3);
%>
<sql:resultSet id="rset3b" name="rset3" scope="page">
<sql:getColumn colName="IndexedID"/> <--- BUG BUG outputs all items
from first query!!
</sql:resultSet>
<% rset3.close();
stmt3.close();
%>
-----Original Message-----
From: Halvorson, Loren
Sent: Tuesday, October 15, 2002 12:05 PM
To: [EMAIL PROTECTED]
Subject: [dbtags] Strange behavior since switching to Tomcat 4.1.12
We are seeing some strange behavior from dbtags since we switched to Tomcat
4.1.12. I'm pretty sure it's related to the new tag pooling feature of
Tomcat. I am wondering if anyone else is having problems.
If we have two statements on the same page, where the first one returns
rows, but the second does not, the second statement tag prints out the
actual text of it's query instead of nothing.
For example:
<sql:statement id="stmt2" conn="conn">
<sql:query>select * from foo/*a query that returns rows*/</sql:query>
<sql:resultSet id="rset2">
</sql:resultSet>
</sql:statement>
<sql:statement id="stmt3" conn="conn">
<sql:query>select * from bar /*a query that returns NO
rows*/</sql:query>
<sql:resultSet id="rset3">
</sql:resultSet>
</sql:statement>
Would actually send back to the browser
"select * from bar /*a query that returns NO rows*/"
Oh I wish we could switch to JSTL (to anticipate the response I know some of
you are thinking), but we have the requirement of supporting JSP 1.1
containers too (like WebSphere 4.0). So let's get busy on that JSP 1.1
back-port of JSTL.
Thanks
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>