Hi Vadim,
Hi all,
As promised, the version that acquires all resources before it starts
executing the queries. Well, the main idea behind it. It is the version that
we use here for ourselves, and it isn't cleaned out yet, but I have a
customer breathing very heavily in my neck, and when I quickly tried to
apply the changes to the version that is in C2.0 right now, I got a lot of
very weird errors. Could be some stupid mistakes I made (after 12 hours of
straight coding, this wouldn't be totally unimaginable).
Anyway, I hope to get some time to try again patching the current version,
but here is my version in case anybody wants to beat me to it :) The main
chunk of changes is in the endExecuteQueryElement(), and some in the
Query.execute().
On a side note, Sven told me I shouldn't strangle him wholly, because I
understood some of his statements wrongly. However, there will be _some_
physical punishment once he gets back ;)
Going back to the dungeons now,
tomK
-----Original Message-----
From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]]
Sent: woensdag 8 augustus 2001 16:15
To: [EMAIL PROTECTED]
Subject: RE: [C2] SQLTransformer
> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, August 08, 2001 9:38 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [C2] SQLTransformer
>
>
> You seem to be absolutely right.
>
> We're using a slightly different version of SQLTransformer (the one Sven
> Beauprez was working on), and he assured me that he had followed the
> evolutions SQLTransformer in C2 and made all relevant patches on our
> version. Now Sven is on a holiday (which is the reason I got involved in
> it), so I'll have to wait a few weeks more before I can strangle him ;)
>
> There's still one problem though: if the pool of connections is empty when
> you arrive at line 827, the thing just explodes (you'll only notice this
> under load).
>
> I've tried to loop there until I get a connection, but this of course
leads
> to a deadlock (almost all our queries are nested 2 deep, so if 20 requests
> arrive at the same time for a pool of 10 connections, all nested queries
are
> deadlocked)
>
> I'm now trying to get a hold on all necessary connections before trying to
> execute the queries. Wish me luck, because it looks like a bee's nest to
> me...
It seems possible to obtain all required connections before executing
queries...
Try to get required number of connections (queries.size()) in
endExecuteQueryElement
method, before executeQuery(0). If you are unable to get connections, you
need to
release all of them and try to get them again in loop. I would recommend to
add small
random delay (as in ethernet collision resolution protocol) before obtaining
connections again - to avoid repetitive deadlocks.
Good luck!
>
> Thanks for your reaction, and my excuses for the misunderstanding
No problem, you are welcome
Vadim
> tomK
>
>
> -----Original Message-----
> From: Vadim Gritsenko [mailto:[EMAIL PROTECTED]]
> Sent: woensdag 8 augustus 2001 15:14
> To: [EMAIL PROTECTED]
> Subject: RE: [C2] SQLTransformer
>
>
> Hi,
>
> I don't know what version of SQLTransformer you are talking about,
> IIRC this was fixed in CVS a weeks ago. If not, please show these
> lines of code.
>
> Right now ($Revision: 1.5.2.6 from cocoon_20_branch), query is executed
> in method "executeQuery(int index)", and it also extracts all results in
> "while (query.next())" loop, and then connection is closed in "finally"
> statement.
>
> Regards,
> Vadim
>
> > -----Original Message-----
> > From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, August 07, 2001 2:41 PM
> > To: [EMAIL PROTECTED]
> > Subject: [C2] SQLTransformer
> >
> >
> > Hi all,
> >
> > There's a serious bug in the SQLTransformer: a query gets executed, and
> > after that the results are sucked out of it. Now, the moment the query
is
> > executed, its Connection is given back to the Pool it belongs is (which
is
> > good). But, if this Connection is reused before the results are sucked
out
> > of it, serious problems arise (genre NullPointerException).
> >
> > The problem does not arise ATM with the Excalibur that is in C2 now,
> because
> > that also has a serious bug in it (which I will report and patch
tomorrow
> to
> > the Avalon people).
> >
> > I'm working on a solution for the SQLTransformer, but I need one piece
of
> > information: can I trust C2 to execute recycle() or dispose() as soon as
> the
> > pipeline has ended executing? This would allow me to allocate a
Connection
> > in the setup(), and throw it back in the Pool in the recycle() resp.
> > dispose().
> >
> > Once this is solved, I will of course send the patch to the list, but I
> need
> > this information to be able to patch it.
> >
> > Thanks a lot,
> > tomK
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, email: [EMAIL PROTECTED]
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, email: [EMAIL PROTECTED]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
SQLTransformer.java.jar
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]