You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Stephan Coboos <cr...@gmx.net> on 2004/10/19 17:25:08 UTC

SQLTransformer, reaction on socket close?

Hi,

I need some "internal" informations. Therefore I'm posting on the dev list.

I'm using the SQLTransformer to receive a very very big set of values 
out from a oracle database. Because the values are very very big, it 
would be nice, if the the connection to the database will be closed if 
the user closes its browser (socket close). Is such a feature 
implemented yet?

Thank you!

Regards
Stephan


Re: SQLTransformer, reaction on socket close?

Posted by Sylvain Wallez <sy...@apache.org>.
Stephan Coboos wrote:

> Hi Sylvain,
>
> One output format will be a raw xml document (generated by the 
> SQLTransformer). It will be parsed by an java client. On the other 
> hand the output will be transformed to a HTML or Excel document by an 
> XSLT Transformer. As you has written in your post before, I think the 
> second one is not possible to detect a "browser cancel"? Is there a 
> workaraound available?


Unfortunately not with XSLT. If the transformation can be streamed (e.g. 
it creates a <table> with the contents of the results), you should 
consider using STX which doesn't buffer the input document as XSLT does.

> What happens on the first one (directly xml output) if the user stops 
> the transfer by closing the browser?


In that case, the server will receive a socket exception, which will 
lead to disposing the pipeline and therefore recycling the 
SQLTransformer, which closes the connection.

> Thank you, Sylvain.


Well, hope this helps :-)

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Re: SQLTransformer, reaction on socket close?

Posted by Joerg Heinicke <jo...@gmx.de>.
On 19.10.2004 20:51, Stephan Coboos wrote:

> What happens on the first one (directly xml output) if the user stops 
> the transfer by closing the browser?

When the XML is not buffered, it is streamed directly to the client. 
Closing the browser prevents the server to write the data to the socket 
(an exception is thrown). This can be handled appropriately. But I don't 
know if the SQLTransformer is doing it at the moment.

Joerg

Re: SQLTransformer, reaction on socket close?

Posted by Stephan Coboos <cr...@gmx.net>.
Hi Sylvain,

One output format will be a raw xml document (generated by the 
SQLTransformer). It will be parsed by an java client. On the other hand 
the output will be transformed to a HTML or Excel document by an XSLT 
Transformer. As you has written in your post before, I think the second 
one is not possible to detect a "browser cancel"? Is there a workaraound 
available?

What happens on the first one (directly xml output) if the user stops 
the transfer by closing the browser?

Thank you, Sylvain.

Regards
Stephan

Sylvain Wallez wrote:

> Stephan Coboos wrote:
>
>> I had forgotten to say: "The database connection should be closed if 
>> the user closes the browser _during reading_." So a hughe set of data 
>> which are not needed should not read again out of the database to 
>> save resources.
>
>
>
> We can know if the user closed her browser only by receiving an 
> excption when trying to send data. That means that output of the 
> SQLTransformer must be streamed down to the browser with no 
> intermediate buffering, which unfortunately is what happens with an 
> XSL transformation.
>
> What are the components after the SQLTransformer?
>
> Sylvain
>



Re: SQLTransformer, reaction on socket close?

Posted by Sylvain Wallez <sy...@apache.org>.
Stephan Coboos wrote:

> I had forgotten to say: "The database connection should be closed if 
> the user closes the browser _during reading_." So a hughe set of data 
> which are not needed should not read again out of the database to save 
> resources.


We can know if the user closed her browser only by receiving an excption 
when trying to send data. That means that output of the SQLTransformer 
must be streamed down to the browser with no intermediate buffering, 
which unfortunately is what happens with an XSL transformation.

What are the components after the SQLTransformer?

Sylvain

-- 
Sylvain Wallez                                  Anyware Technologies
http://www.apache.org/~sylvain           http://www.anyware-tech.com
{ XML, Java, Cocoon, OpenSource }*{ Training, Consulting, Projects }


Re: SQLTransformer, reaction on socket close?

Posted by Stephan Coboos <cr...@gmx.net>.
I had forgotten to say: "The database connection should be closed if the 
user closes the browser _during reading_." So a hughe set of data which 
are not needed should not read again out of the database to save resources.

Thank you.

Stephan

Stephan Coboos wrote:

> Hi,
>
> I need some "internal" informations. Therefore I'm posting on the dev 
> list.
>
> I'm using the SQLTransformer to receive a very very big set of values 
> out from a oracle database. Because the values are very very big, it 
> would be nice, if the the connection to the database will be closed if 
> the user closes its browser (socket close). Is such a feature 
> implemented yet?
>
> Thank you!
>
> Regards
> Stephan
>
>