Return-Path: Delivered-To: apmail-cocoon-dev-archive@www.apache.org Received: (qmail 81952 invoked from network); 1 Dec 2003 06:09:54 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 1 Dec 2003 06:09:54 -0000 Received: (qmail 50817 invoked by uid 500); 1 Dec 2003 06:09:29 -0000 Delivered-To: apmail-cocoon-dev-archive@cocoon.apache.org Received: (qmail 50752 invoked by uid 500); 1 Dec 2003 06:09:29 -0000 Mailing-List: contact dev-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: list-post: Reply-To: dev@cocoon.apache.org Delivered-To: mailing list dev@cocoon.apache.org Received: (qmail 50706 invoked from network); 1 Dec 2003 06:09:29 -0000 Received: from unknown (HELO exchange.sun.com) (192.18.33.10) by daedalus.apache.org with SMTP; 1 Dec 2003 06:09:29 -0000 Received: (qmail 13001 invoked by uid 50); 1 Dec 2003 06:09:49 -0000 Date: 1 Dec 2003 06:09:49 -0000 Message-ID: <20031201060949.13000.qmail@nagoya.betaversion.org> From: bugzilla@apache.org To: dev@cocoon.apache.org Cc: Subject: DO NOT REPLY [Bug 25098] New: - SQLTransformer fails to return number of rows updated X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT . ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE. http://nagoya.apache.org/bugzilla/show_bug.cgi?id=25098 SQLTransformer fails to return number of rows updated Summary: SQLTransformer fails to return number of rows updated Product: Cocoon 2 Version: 2.1.3 Platform: All OS/Version: All Status: NEW Severity: Major Priority: Other Component: general components AssignedTo: dev@cocoon.apache.org ReportedBy: dean.cording@kaz-group.com The SQLTransformer fails to return the number of rows updated as a result of an INSERT, UPDATE or DELETE statement. The SQLTransformer.Query.serializeRows method will return the number of updated rows as a returncode attribute but it is never called for update queries. The following code fragment from SQLTransform.executeQuery processes the results from the query: 361 if ( !query.isStoredProcedure() ) { 362 while ( query.next() ) { 363 this.start( query.row_name, attr ); 364 query.serializeRow(this.manager); 365 if ( index + 1 < queries.size() ) { 366 executeQuery( index + 1 ); 367 } 368 this.end( query.row_name ); 369 } 370 } The SQLTransformer.Query.next method always returns false for any update query and therefore query.serializeRow is never called and the results are never reported. It also suggests that any queries after an update query will never be executed as well. As a general comment, the use of recursion in this part of the code (executeQuery calls itself) is poor coding form. It is not necessary, could be done simpler with a while loop and results in tangles like the one described.