<div><font color="#000000"><font>You should spend as little time inside OnMessage() calls as possible.  It will block the engine from processing further messages.<br></font></font></div><div><font color="#000000"><font><br>

</font></font></div><div><font color="#000000"><font>Your DB connection limit doesn't seem like a huge issue.  In OnMessage, you can push your DB-task's information to a work queue, and another thread could iterate on that queue in a synchronized fashion, thus keeping to only one DB connection at a time.<br>

</font></font></div><div><font color="#000000"><font><br></font></font></div><div><font color="#000000"><font>I'm sure there are many other ways to handle it, some better than mine, but that's the first thing that came to mind.<br>

</font></font></div><div><br></div><div>-Grant</div><div><br></div><div class="gmail_quote">On Tue, May 29, 2012 at 6:27 AM, Ondra Květ <span dir="ltr"><<a href="mailto:kwitee@gmail.com" target="_blank">kwitee@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">HI,<br>
it is possible that long performed OnMessage method may cause reconnect?<br>
I am calling database procedure in this method and it was working<br>
properly at first. But after some DB changes I found some weird<br>
reconnecting every few minutes. I can't do this in a separate thread<br>
because my DB connections are limited.<br>
DB procedure lasts about 70 milliseconds.<br>
Thanks.<br>
<br>
kwitee<br>
_______________________________________________<br>
Quickfixn mailing list<br>
<a href="mailto:Quickfixn@lists.quickfixn.com">Quickfixn@lists.quickfixn.com</a><br>
<a href="http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com" target="_blank">http://lists.quickfixn.com/listinfo.cgi/quickfixn-quickfixn.com</a><br>
</blockquote></div><br><br clear="all"><br>-- <br><div><font><span style="background-color:#000000"><span style="background-color:#ffffff">Grant Birchmeier</span></span></font><font><font color="#3333ff"><br></font></font></div>

<div><font><b><font color="#3333ff"><span style="background-color:#ffcc33"><span style="background-color:#ffcc66"><span style="background-color:#ffcc99"><span style="background-color:#ffffff"><span style="background-color:#ffcc00">Connamara Systems, LLC</span></span></span></span></span></font></b></font><br>

</div><div><font><b>Made-To-Measure Trading Solutions.</b></font></div><div><font>Exactly what you need. No more. No less.</font><font><b><font color="#3333ff"><br></font></b></font></div><div><font><a href="http://connamara.com" target="_blank">http://connamara.com</a><br>

</font></div><br>