<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">&lt;<a href="mailto:sdouglas@redhat.com" target="_blank">sdouglas@redhat.com</a>&gt;</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&#39;Neil &lt;<a href="mailto:bill@dartalley.com">bill@dartalley.com</a>&gt; wrote:<br>
&gt; Hello,<br>
&gt;<br>
&gt; I&#39;m trying to make a handler that manages a request scoped sql transaction.<br>
&gt; Ideally it would be a middleware handler that opens the connection and<br>
&gt; starts the transaction and after the chain of handlers is finished it will<br>
&gt; commit the transaction. The issue I am facing is the browser can receive the<br>
&gt; data before the transaction is committed since the data is sent further down<br>
&gt; the chain.<br>
&gt;<br>
&gt; Is there some type of hook where I can commit / close the transaction before<br>
&gt; any data is sent? This should work fine in a blocking handler but an<br>
&gt; asynchronous one may have issues?<br>
&gt;<br>
&gt; My other thought is to make a Handler that expects some object to be<br>
&gt; returned. In this handler commit / close the connection as soon as the<br>
&gt; object is returned then send the data to the browser after. Would this be my<br>
&gt; best option?<br>
&gt;<br>
&gt; Thanks,<br>
&gt; Bill<br>
&gt;<br>
</div></div>&gt; ______________________________<wbr>_________________<br>
&gt; undertow-dev mailing list<br>
&gt; <a href="mailto:undertow-dev@lists.jboss.org">undertow-dev@lists.jboss.org</a><br>
&gt; <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>