<div dir="ltr">Exactly what I was looking for thanks!</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Nov 20, 2016 at 4:23 PM, Stuart Douglas <span dir="ltr"><<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">You can use io.undertow.server.<wbr>HttpServerExchange#<wbr>addResponseCommitListener<br>
and implement the ResponseCommitListener interface.<br>
<br>
Stuart<br>
<div><div class="h5"><br>
On Sun, Nov 20, 2016 at 8:24 AM, Bill O'Neil <<a href="mailto:bill@dartalley.com">bill@dartalley.com</a>> wrote:<br>
> Hello,<br>
><br>
> I'm trying to make a handler that manages a request scoped sql transaction.<br>
> Ideally it would be a middleware handler that opens the connection and<br>
> starts the transaction and after the chain of handlers is finished it will<br>
> commit the transaction. The issue I am facing is the browser can receive the<br>
> data before the transaction is committed since the data is sent further down<br>
> the chain.<br>
><br>
> Is there some type of hook where I can commit / close the transaction before<br>
> any data is sent? This should work fine in a blocking handler but an<br>
> asynchronous one may have issues?<br>
><br>
> My other thought is to make a Handler that expects some object to be<br>
> returned. In this handler commit / close the connection as soon as the<br>
> object is returned then send the data to the browser after. Would this be my<br>
> best option?<br>
><br>
> Thanks,<br>
> Bill<br>
><br>
</div></div>> ______________________________<wbr>_________________<br>
> undertow-dev mailing list<br>
> <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
> <a href="https://lists.jboss.org/mailman/listinfo/undertow-dev" rel="noreferrer" target="_blank">https://lists.jboss.org/<wbr>mailman/listinfo/undertow-dev</a><br>
</blockquote></div><br></div>