<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<p>Hello Florin,</p>
<p>having looked at your logs, it seems that maybe explicit setting
of validationQuery in Quartz data source setup would help. (See <a
href="http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigDataSources.html">http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigDataSources.html</a>.)</p>
<p>Unfortunately, current midPoint implementation does not allow to
configure Quartz data source parameters. So, there are the
following three possibilities:</p>
<ol>
<li>Take an alternative route, and use application server-defined
data source (with validationQuery set up).<br>
</li>
<li>Patch Task Manager implementation by adding appropriate lines
to Quartz configuration (see LocalNodeManager.java:87-90).</li>
<li>Wait until we implement it - I've created an issue <a
href="https://jira.evolveum.com/browse/MID-3347">MID-3347</a>
for this.<br>
</li>
</ol>
<p>As for the first one (externally defined data source): Please see
<a
href="https://wiki.evolveum.com/display/midPoint/Repository+Configuration#RepositoryConfiguration-Datasourceconfiguration">https://wiki.evolveum.com/display/midPoint/Repository+Configuration#RepositoryConfiguration-Datasourceconfiguration</a>
on how to configure midPoint repository with the data source. This
data source will be used also by Quartz, if not overriden in
<taskManager> section. It should work but I don't remember
if someone actually tested this.</p>
<p>Concerning autoReconnect: I have no experiences with this
setting. I agree with you that about the hesitation of using it in
production environment. If really needed, I'd recommend to
separate midPoint repository configuration from Quartz
configuration by using different JDBC URLs for the two: the
standard one for the repository and the one with
"autoReconnect=true" for Quartz. In this way, potential negative
effects should be restricted to task management functionality
only. But, overall, I'd suggest trying to eliminate the problem by
setting validationQuery first.<br>
</p>
<p>Best regards,<br>
</p>
<pre class="moz-signature" cols="72">Pavol Mederly
Software developer
evolveum.com
</pre>
<div class="moz-cite-prefix">On 14.08.2016 22:40, Florin. Stingaciu
wrote:<br>
</div>
<blockquote
cite="mid:CAMQHPY28sPVw4Kyh0eTRM_KPb5jQiREowrhqL2w5k=YeAwk1mw@mail.gmail.com"
type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div>I'm trying to configure an active/active configuration, and
experiencing some issues with the Quartz scheduler. The SQL
connection seems to timeout quite often and result in many
warning messages. I'm also experiencing some errors -- as the
timeout closes the connection, some processes are still trying
to commit using that stale handler. </div>
<div><br>
</div>
<div>Here are some relevant logs from both midPoint instances in
this cluster: <a moz-do-not-send="true"
href="http://pastebin.com/JFjqrLnT">http://pastebin.com/JFjqrLnT</a> <a
moz-do-not-send="true" href="http://pastebin.com/1vy4iYPY">http://pastebin.com/1vy4iYPY</a><br>
<br>
Also here's the relevant portion of my config.xml file: <a
moz-do-not-send="true" href="http://pastebin.com/WbydcCC8">http://pastebin.com/WbydcCC8</a></div>
<div><br>
Following the suggestions in the warnings, I've started to
look at autoReconnect propriety of the JDBC connector and
applied it to my configs like so:</div>
<div><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span
class=""><jdbcUrl>jdbc:mysql://SERVER:3306/midpoint_dev?autoReconnect=true</jdbcUrl></span></blockquote>
<div><br>
</div>
<div>Since implementing this change, the errors and warnings
seem to have disappeared. I will continue to monitor the
logs and ensure this actually the case. </div>
<div><br>
</div>
<div>Reading the mysql docs, I found that this is not
recommended as this may cause data inconsistency issues and
that stale connection exceptions should be properly caught
within the application. Namely:</div>
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">The
use of this feature is not recommended, because it has side
effects related to session state and data consistency when
applications don't handle SQLExceptions properly, and is
only designed to be used when you are unable to configure
your application to handle SQLExceptions resulting from dead
and stale connections properly.</blockquote>
<div><br>
Do you have any recommended configuration for this scenario?
I'd like to move my current production environment in an
active active configuration, however as of right now I'm
hesitant to do so in order to avoid any data corruption.
Especially since it's quite difficult to test for data
consistency issues that may arise from using autoReconnect
in my dev environment. <br>
<br>
Thanks, </div>
<div>-F </div>
<div> </div>
</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
midPoint mailing list
<a class="moz-txt-link-abbreviated" href="mailto:midPoint@lists.evolveum.com">midPoint@lists.evolveum.com</a>
<a class="moz-txt-link-freetext" href="http://lists.evolveum.com/mailman/listinfo/midpoint">http://lists.evolveum.com/mailman/listinfo/midpoint</a>
</pre>
</blockquote>
<br>
</body>
</html>