<!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">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;">
    Pessimistic locking iso=NONE to MVCC causing issues
</h3>
<span style="margin-bottom: 10px;">
    created by <a href="http://community.jboss.org/people/sunnyos">sunny oswal</a> in <i>JBoss Cache</i> - <a href="http://community.jboss.org/message/549001#549001">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">

<div class="jive-rendered-content"><p><br/>Hi All,</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I was using version 2.1.0 with Node locking set to&#160; "Pessimistic Locking" and isolation level = "NONE". I have now upgraded&#160; to the 3.2.5 version.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>The application is a multi threaded J2EE -&#160; MDB (multiple instance &gt; 200) application. At a time there can be&#160; multiple threads attempting to insert and/or read from the cache. The&#160; data does not change very often and I do not care if the data is stale&#160; as we expire the cache every 20 mins and any processing with stale data&#160; occurs we can correct it offline. So staleness of data is not an issue.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>I have a few questions:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>1) This version 3.2.5GA has depreciated&#160; pessimistic and optimistic locking: What does this mean? Is this safe to&#160; use the same configuration? Pessimistic + Isolation="None"</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>2) When testing&#160; with MVCC I noticed the following exception (full stack pasted below)&#160; and a transaction rollback:</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>&#160;&#160;&#160; org.jboss.cache.lock.TimeoutException: Unable to acquire lock on Fqn&#160; [/xxxxx] after [20000] milliseconds for requestor</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>- I&#160; also noticed the performance of the application as highly degraded&#160; towards the end of the (stress) test as many threads were locked</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p><br/>3)&#160; Is there an alternative which will allow us to use the current version&#160; with no locking / "none" isolation level without using a depricated part&#160; of the API. Or is it safe to use pessimistic logging.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>4)&#160; Assuming currently, pessimistic locking with NONE isolation works for&#160; us, what is the future plan for the API as we intend on upgrading to&#160; newer version but would not like locking.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>================================================</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p>STACK<br/>=====<br/>Target&#160; exception stack trace:<br/>org.jboss.cache.lock.TimeoutException: Unable&#160; to acquire lock on Fqn [/getAccountByAltID] after [20000] milliseconds&#160; for requestor [GlobalTransaction:&lt;null&gt;:547]! Lock held by&#160; [GlobalTransaction:&lt;null&gt;:544]<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.mvcc.MVCCNodeHelper.acquireLock(MVCCNodeHelper.java:159)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:197)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.mvcc.MVCCNodeHelper.wrapNodeForWriting(MVCCNodeHelper.java:186)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.MVCCLockingInterceptor.handlePutKeyValueCommand(MVCCLockingInterceptor.java:101)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.base.PrePostProcessingCommandInterceptor.visitPutKeyValueCommand(PrePostProcessingCommandInterceptor.java:88)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.base.CommandInterceptor.handleDefault(CommandInterceptor.java:131)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:65)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.TxInterceptor.attachGtxAndPassUpChain(TxInterceptor.java:301)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.TxInterceptor.handleDefault(TxInterceptor.java:283)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.commands.AbstractVisitor.visitPutKeyValueCommand(AbstractVisitor.java:65)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.base.CommandInterceptor.invokeNextInterceptor(CommandInterceptor.java:116)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.InvocationContextInterceptor.handleAll(InvocationContextInterceptor.java:178)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.InvocationContextInterceptor.visitPutKeyValueCommand(InvocationContextInterceptor.java:82)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.commands.write.PutKeyValueCommand.acceptVisitor(PutKeyValueCommand.java:100)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.interceptors.InterceptorChain.invoke(InterceptorChain.java:287)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; at&#160; org.jboss.cache.invocation.CacheInvocationDelegate.put(CacheInvocationDelegate.java:555)<br/>&#160;&#160;&#160;&#160;&#160;&#160;&#160; ..........</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/549001#549001">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>