You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Leszek Gawron <ou...@wlkp.org> on 2003/11/04 10:22:11 UTC

Re: ESQL question

On Fri, Oct 31, 2003 at 03:45:15PM +0100, Torsten Curdt wrote:
> > Now I see that a simple query without parameters is also prepared
> >which makes the execution a lot slower under Pervasive 2000i (I have never
> >seen more crappy database).
> 
> IIRC this came up before....
> 
> >Is it an intentional change ?
> 
> Well, yes, kinda....
> 
> Ok.. here it goes: when I was doing some work
> on esql I found the esql statement handling
> to be very ugly.
> 
> After some googling it seemed that it's a
> consensus that usually (of course depends
> on the driver implementation) the prepared
> statements are meant to be a faster choice.
> 
> Since the code got nicer I changed it that
> way ...not exspecting to see such a speed
> difference as you might see now (how much
> is it?)
> 
> So... it seems this is another option per
> database. If you could come up with a
> nice patch - no problem.
I think sometimes I get a blackout:
http://marc.theaimsgroup.com/?l=xml-cocoon-dev&w=2&r=1&s=PreparedStatement+pervasive&q=b

I forgot we already cleared the thing that properly initiated PreparedStatement
in Pervasive is as fast as plain Statement. 

> ...but I was already talking to Christian
> about this: maybe we should step back
> and reanalize the cocoon database
> connectivity in general again.
> 
> I'd really love to merge esql and the
> sql transformer sharing the same syntax
> ...and more or less the same code. AFA
> this is possible...
I would really like to use esql with "real" prepared statements, I mean when
statements that are really reused when they are being run in loop.

something like:

<esql:declare-query name="users-insert">
	<esql:query>insert into users table values ( <esql:parameter name="first"/>,
                <esql:parameter name="second"/> ) </esql:query>
</esql:declare-query>

and then:


<xsp:logic>

for ( int i = 0; i &lt; 100; ++i ) {
	<esql:execute-query>
		<esql:query ref="users-insert">
			<esql:parameter name="first">value1</esql:parameter>
			</esql:parameter name="second">value2</esql:parameter>
		</esql:query>
	</esql:execute-query>
}

</xsp:logic>

I like ESQL a lot because: 
* the deployment process is very simple (no compiling/building)
* keeps the code open so any change (even on running site) is simple
* makes the JDBC not so verbose
  serializing data from query to xml using plain JDBC is a real pain in the
  ass.
* I still find OJB/Hibernate 
  a) too much overhead for some of my projects
  b) not possible to use in some of my other project (for example because of
     dynamic table generation during system usage or strong reporting features
     needed)
* It is a very easy start for newbie cocooners. Now when I have some cocoon
  knowledge describing the basic cocoon mechanisms can take some hours and
  kill the listener :)
> 
> Maybe it's time to put up a wiki page
> where we can collect some RT on a new
> sql connectivity.
> 
> I am sure we could easily create some
> stylesheets for migration to the (maybe?)
> new sytax. So this can be pretty painless
> for users.
> 
> What do you think?

I would be very happy to help you in some way. I have some experience in
writing software but looking at cocoon I know I wouldn't be able to handle
even small change myself as I have little confidence in cocoon internals. I'm
offering myself as a person who has some ideas of extending ESQL and being
able to do some "dirty work" after the ideas are talked over.

my regards	
	lg
-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/       ouzo@wlkp.org           _\\()//_
         .'/()\'.     Phone: +48(501)720812     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |