cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 30898] New: - Multiple results not processed by SQLTransformer
Date Fri, 27 Aug 2004 15:18:17 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=30898>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=30898

Multiple results not processed by SQLTransformer

           Summary: Multiple results not processed by SQLTransformer
           Product: Cocoon 2
           Version: 2.1.5
          Platform: PC
        OS/Version: Windows NT/2K
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: blocks
        AssignedTo: dev@cocoon.apache.org
        ReportedBy: ats37@hotmail.com


I have a stored procedure which has four results; two update counts, a result
set (which is what I'm wanting to use in my stylesheet), and another update
count.  Asides from my problem in #30894, this wouldn't work anyway as the
SQLTransformer only appears to handle the first result.  Query.execute() has

                boolean result = pst.execute();
                if ( result ) {
                    rs = pst.getResultSet();
                    md = rs.getMetaData();
                } else {
                    rv = pst.getUpdateCount();
                }

which sets the variables according to "the form of the *first* result" (to quote
PreparedStatement's javadocs, my emphasis).  However, "Some prepared statements
return multiple results" (again, from the javadocs) yet there's nothing in
SQLTransformer to handle this; Query.next() finishes as soon as it finds an
update count or the end of the current result set, and getMoreResults() never
gets called.  Obviously, this means it would stop after my stored proc's first
update count ("1 row inserted" into an audit table) and never get to the real
data that I'm interested in.

Even forgetting SPs, you can see the same effect with SQL queries by using two
SELECTs in a single <query>.  If I run e.g.

select distinct Permission_Code from USER_PERMISSIONS
select distinct Sys_User_Code from USER_PERMISSIONS
go

in ISQL, I get two result sets returned in the output as expected.  If I use

			<query>
select distinct Permission_Code from USER_PERMISSIONS
select distinct Sys_User_Code from USER_PERMISSIONS
			</query>

with the SQLTransformer, I only get the first set of values returned.  If all
the results were processed for a query (e.g. a rowset for each result containing
either the row data or a returncode as appropriate, maybe?) then I'd stand more
chance of being able to get my SP working.

Mime
View raw message