<!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="https://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;">
Is optimistic-entity an inappropriate configuration for a Hibernate 2nd level cache configuration?
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/tmuldo">Tom Muldoon</a> in <i>JBoss Cache</i> - <a href="https://community.jboss.org/message/731346#731346">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>After upgrading jgroups from 2.5.1 to 2.7.0GA, we encountered ClassNotFoundExceptions that we tracked down to class loader issues between swarmcache (our Hibernate 2<sup>nd</sup> level cache provider) and jgroups. To make a long story short, we’re now attempting a cut over to jboss cache.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Some specifics…</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>JBoss AS 5.1.0.GA</p><p>hibernate-jbosscache2-3.3.1.GA</p><p>jbosscache-core 3.2.5GA </p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>With that said, here’s my hibernate configuration in which we ran into DataVersioningExceptions with queries…</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>{code:xml}</p><p>      <span style="font-family: 'Courier New'; color: teal; font-size: 10pt;"><</span><span style="font-family: 'Courier New'; color: #3f7f7f; font-size: 10pt;">property</span><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: #7f007f;">name</span><span style="color: black;">=</span><em style="color: #2a00ff;">"hibernate.cache.use_second_level_cache"</em> <span style="color: #7f007f;">value</span><span style="color: black;">=</span><em style="color: #2a00ff;">"true"</em> <span style="color: teal;">/></span></span></p><p>      <span style="font-family: 'Courier New'; color: teal; font-size: 10pt;"><</span><span style="font-family: 'Courier New'; color: #3f7f7f; font-size: 10pt;">property</span><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: #7f007f;">name</span><span style="color: black;">=</span><em style="color: #2a00ff;">"hibernate.cache.use_query_cache"</em> <span style="color: #7f007f;">value</span><span style="color: black;">=</span><em style="color: #2a00ff;">"true"</em> <span style="color: teal;">/></span></span></p><p>      <span style="font-family: 'Courier New'; color: teal; font-size: 10pt;"><</span><span style="font-family: 'Courier New'; color: #3f7f7f; font-size: 10pt;">property</span><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: #7f007f;">name</span><span style="color: black;">=</span><em style="color: #2a00ff;">"hibernate.cache.region.jbc2.query.localonly"</em> <span style="color: #7f007f;">value</span><span style="color: black;">=</span><em style="color: #2a00ff;">"true"</em> <span style="color: teal;">/></span></span></p><p>      <span style="font-family: 'Courier New'; color: teal; font-size: 10pt;"><</span><span style="font-family: 'Courier New'; color: #3f7f7f; font-size: 10pt;">property</span><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: #7f007f;">name</span><span style="color: black;">=</span><em style="color: #2a00ff;">"hibernate.cache.region.factory_class"</em> <span style="color: #7f007f;">value</span><span style="color: black;">=</span><em style="color: #2a00ff;">"org.hibernate.cache.jbc2.MultiplexedJBossCacheRegionFactory"</em> <span style="color: teal;">/></span></span></p><p>      <span style="font-family: 'Courier New'; color: teal; font-size: 10pt;"><</span><span style="font-family: 'Courier New'; color: #3f7f7f; font-size: 10pt;">property</span><span style="font-family: 'Courier New'; font-size: 10pt;"> <span style="color: #7f007f;">name</span><span style="color: black;">=</span><em style="color: #2a00ff;">"hibernate.cache.region_prefix"</em> <span style="color: #7f007f;">value</span><span style="color: black;">=</span><em style="color: #2a00ff;">"hibernate.firstbest"</em> <span style="color: teal;">/></span></span></p><p>{code}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Is optimistic-entity an inappropriate configuration for a Hibernate 2<sup>nd</sup> level cache configuration? Assuming so, how do we deal with the DataVersioningExceptions? Is mvcc-entity a more appropriate configuration?</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Sincerely, Tom</p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/731346#731346">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in JBoss Cache at <a href="https://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>