cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christian Haul <>
Subject Re: cvs commit: xml-cocoon2/src/java/org/apache/cocoon/components/language/markup/xsp/java esql.xsl
Date Fri, 28 Jun 2002 09:44:20 GMT
On 28.Jun.2002 -- 11:07 AM, Torsten Curdt wrote:
> <snip/>
> >      Multiple results seem not to be supported by some DBMSs (i.e. Oracle
> > and Informix). Therefore this is made optional in ESQL. A new parameter
> > (esql:allow-multiple-results) to esql:connection re-enables it. See
> > EsqlConnection for details.
> Hm, Christian, I haven't yet looked into the changes but I'd be in favor of 
> keeping the old (IMO correct) behaviour and support _disabling_ it for those 
> special cases...
> What do you think?

In general I'm in favour of exposing the "correct" behaviour and
switching to "work around" only on request. In this case

*) multiple results are only useful with stored procedures

*) "correct" behaviour really breaks ESQL at least on Oracle and
   This makes a bad first impression on Cocoon and ESQL.
   (Oracle enters endless loop for updates since it always returns
    the same updateCount; Informix throws an exception on any ESQL
	since it allows getUpdateCount() only be called once per
	execute() whereas JDBC specs it can be called once after every

*) the correct behaviour was introduced only in CVS and hasn't been
   released yet, so this change will break less installations when the
   next release is due.

It would help to decide this if we knew about other DBMSs. In short:
Check if the following snippet works with your favourite DBMS (provide
request parameters "old" and "new"!!!)

   HSQLDB 1.63  : OK (no update count, though)
   Oracle 8.1.5 : endless loop on update, select is OK
   Informix 9.23: both result in exception "Method may only be called once"
   DB2          :
   Sybase       :
   MS SQL       :
   MySQL        :
   PostgreSQL   :
   Firebird     :
   SAPDB        :
   ...          :   

		<esql:pool>personnel</esql:pool><!-- change this -->

		  if (<xsp-request:get-parameter name="old" default=""/>!=""){
	   		    UPDATE department SET name=<esql:parameter type="string"><xsp:expr>new</xsp:expr></esql:parameter>
WHERE name=<esql:parameter><xsp:expr>old</xsp:expr></esql:parameter>
	   		     <p>Modified <esql:get-update-count/> rows</p>

     	  <esql:query>select * from department</esql:query>
     	      <para><esql:get-string column="name"/></para>

Anyway, changing it back is just changing the default in and adjusting the docs.


C h r i s t i a n       H a u l
    fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

To unsubscribe, e-mail:
For additional commands, email:

View raw message