<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">

<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>

                                <td>

                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="http://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>

                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px;  -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
    How to prevent Jboss cache lock TimeoutException/deaklocks
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/weix">Wei Xue</a> in <i>JBoss Cache</i> - <a href="http://community.jboss.org/message/554226#554226">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p>Hi,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>We are using jboss cache 3.2.0 in our application which is deployed on jboss 5.1.0.GA&#160; AS. I have setup jBoss clustering using farm deployment</p><p>with two nodes running in a cluster.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>During load testing, we encountered lockTimeoutException on both nodes. I grabbed a piece of information from server.log on two nodes.</p><p><span style="color: #800080;">Node 1:</span></p><p>2010-07-21 08:31:34,841 WARN&#160; [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (pool-22-thread-560) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for <a class="jive-link-external-small" href="mailto:com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@746fee83">com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@746fee83</a></p><p>org.jboss.cache.lock.TimeoutException: Unable to acquire lock on Fqn [<strong>/serverData/31510/serverParams</strong>] after [15000] milliseconds for requestor [GlobalTransaction:&lt;<span style="color: #800080;">10.17.223.88:58023&gt;:3586</span>]! Lock held by [<span style="color: #339966;">GlobalTransaction:&lt;10.17.223.89:55770&gt;:3588</span>]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><span style="color: #339966;">Node 2:</span></p><p>2010-07-21 08:31:32,064 WARN&#160; [com.arjuna.ats.arjuna.logging.arjLoggerI18N] (Thread-37) [com.arjuna.ats.arjuna.coordinator.TwoPhaseCoordinator_2] TwoPhaseCoordinator.beforeCompletion - failed for <a class="jive-link-external-small" href="mailto:com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@2fdc3f43">com.arjuna.ats.internal.jta.resources.arjunacore.SynchronizationImple@2fdc3f43</a></p><p>org.jboss.cache.lock.TimeoutException: Unable to acquire lock on Fqn [<strong>/serverData/31510/serverParams</strong>] after [15000] milliseconds for requestor [GlobalTransaction:&lt;<span style="color: #339966;">10.17.223.89:55770&gt;:3588</span>]! Lock held by [GlobalTransaction:&lt;<span style="color: #800080;">10.17.223.88:58023&gt;:3586</span>]</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>You can find they are blocked by each other. Conceptually one should get a lock, and the other will get lock TimeoutException. But why no one</p><p>get this lock?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Here is my jboss cache configuration regarding the locking:</p><p>&lt;locking<br/>&#160;&#160;&#160; isolationLevel="REPEATABLE_READ"<br/>&#160;&#160;&#160; lockAcquisitionTimeout="15000"<br/>&#160;&#160;&#160; lockParentForChildInsertRemove="false"<br/>&#160;&#160;&#160; concurrencyLevel="5000"<br/>&#160;&#160;&#160; useLockStriping="false"<br/>&#160;&#160;&#160; /&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>How to prevent this happen and why this happens?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>Thank you in advance,</p><p>Wei</p></div>

<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
    <p style="margin: 0;">Reply to this message by <a href="http://community.jboss.org/message/554226#554226">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Cache at <a href="http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2052">Community</a></p>
</div></td>
                        </tr>
                    </tbody>
                </table>


                </td>
            </tr>
        </tbody>
    </table>

</div>

</body>
</html>