<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" /> <base href="https://hibernate.atlassian.net" /> 
        <title>Message Title</title> 
    </head> 
    <body class="jira" style="color: #333; font-family: Arial, sans-serif; font-size: 14px; line-height: 1.429"> 
        <table id="background-table" cellpadding="0" cellspacing="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f5f5f5; border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
            <!-- header here --> 
            <tr> 
                <td id="header-pattern-container" style="padding: 0px; border-collapse: collapse; padding: 10px 20px"> 
                    <table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                        <tr> 
                            <td id="header-avatar-image-container" valign="top" style="padding: 0px; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 8px"> <img id="header-avatar-image" class="image_fix" src="https://secure.gravatar.com/avatar/d6d261c37a10a837178eff09bd7b2d3c?d=mm&amp;s=48" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top" /> 
                            </td> 
                            <td id="header-text-container" valign="middle" style="padding: 0px; border-collapse: collapse; vertical-align: middle; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> <a class="user-hover" rel="nalseddeg" id="email_nalseddeg" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?name=nalseddeg" style="color:#6c797f;; color: #3b73af; text-decoration: none">NIZAR</a> <strong>commented</strong> on <a href="https://hibernate.atlassian.net/browse/HHH-9070" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-static-bug-15ab583d-ab19-48a5-9fb3-7f0756e6e4c6" height="16" width="16" border="0" align="absmiddle" alt="Bug" /> HHH-9070</a> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <tr> 
                <td id="email-content-container" style="padding: 0px; border-collapse: collapse; padding: 0 20px"> 
                    <table id="email-content-table" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; border-spacing: 0; border-collapse: separate"> 
                        <tr> 
                            <!-- there needs to be content in the cell for it to render in some clients --> 
                            <td class="email-content-rounded-top mobile-expand" style="padding: 0px; border-collapse: collapse; color: #fff; padding: 0 15px 0 16px; height: 15px; background-color: #fff; border-left: 1px solid #ccc; border-top: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom: 0; border-top-right-radius: 5px; border-top-left-radius: 5px; height: 10px; line-height: 10px; padding: 0 15px 0 16px; mso-line-height-rule: exactly">
                                &nbsp;
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #fff"> 
                                <table class="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                    <tr> 
                                        <td style="vertical-align: top;; padding: 0px; border-collapse: collapse; padding-right: 5px; font-size: 20px; line-height: 30px; mso-line-height-rule: exactly" class="page-title-pattern-header-container"> <span class="page-title-pattern-header" style="font-family: Arial, sans-serif; padding: 0; font-size: 20px; line-height: 30px; mso-text-raise: 2px; mso-line-height-rule: exactly; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HHH-9070" style="color: #3b73af; text-decoration: none">Re: Deadlock using ehcache 2.7.5 and CacheConcurrencyStrategy.READ_WRITE </a> </span> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td id="text-paragraph-pattern-top" class="email-content-main mobile-expand  comment-top-pattern" style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #fff; border-bottom: none; padding-bottom: 0"> 
                                <table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
                                    <tr> 
                                        <td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0px; border-collapse: collapse; padding: 0 0 10px 0"> 
                                            <p style="margin: 10px 0 0 0">Hello Brett Meyer, We have been fighting with this issue for a while, every week we have to restart our service. I am attaching the error below. Is this related to this bug or something different ???</p> 
                                            <p style="margin: 10px 0 0 0">We are using Hibernate 3.2, ehcache 2.6.6 and terracotta-3.7.5..</p> 
                                            <p style="margin: 10px 0 0 0">ERROR 2014-08-04 09:42:51,918 org.hibernate.engine.ActionQueue pool-1-thread-33 - could not release a cache lock<br /> org.hibernate.cache.CacheException: net.sf.ehcache.CacheException: Underlying Terracotta connection closed! Can't act on clustered lock anymore... <br /> at net.sf.ehcache.hibernate.regions.EhcacheTransactionalDataRegion.writeLock(EhcacheTransactionalDataRegion.java:204)<br /> at net.sf.ehcache.hibernate.strategy.ReadWriteEhcacheEntityRegionAccessStrategy.afterUpdate(ReadWriteEhcacheEntityRegionAccessStrategy.java:92)<br /> at net.sf.ehcache.hibernate.nonstop.NonstopAwareEntityRegionAccessStrategy.afterUpdate(NonstopAwareEntityRegionAccessStrategy.java:82)<br /> at org.hibernate.action.EntityUpdateAction.afterTransactionCompletion(EntityUpdateAction.java:256)<br /> at org.hibernate.engine.ActionQueue.afterTransactionCompletion(ActionQueue.java:198)<br /> at org.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:452)<br /> at org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:252)<br /> at org.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:150)<br /> at org.springframework.orm.hibernate3.HibernateTransactionManager.doCommit(HibernateTransactionManager.java:655)<br /> at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:709)<br /> at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)<br /> at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)<br /> at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)<br /> at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)<br /> at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:635)<br /> at com.X.Y.dao.createDAO$$EnhancerByCGLIB$$1da8f8bd.saveBatch(&lt;generated&gt;)<br /> at com.X.Y.service.XyzServlet.createObjectX(XYZ.java:197)</p> 
                                            <p style="margin: 10px 0 0 0"> Here is the saveBatch method:</p> 
                                            <p style="margin: 10px 0 0 0">@Transactional(readOnly = false,isolation = Isolation.READ_COMMITTED, propagation = Propagation.REQUIRED) <br /> @Override<br /> public String saveBatch(final T obj){<br /> String id = null;<br /> try {<br /> /**</p> 
                                            <ul> 
                                                <li>
                                                    This code will create a new session if one is not already bound to the thread, execute the callback code,
                                                </li> 
                                                <li>
                                                    then close the session and release the database connection back to the pool.
                                                </li> 
                                                <li>
                                                    Making direct calls to the SessionFactory is not recommended because it is very easy to leak database connections if the sessions are not closed properly.<br /> */<br /> id = (String) getHibernateTemplate().execute(new HibernateCallback() 
                                                    <div class="error">
                                                        <span class="error">Unknown macro: { public Object doInHibernate(Session session) throws HibernateException,SQLException { session.setCacheMode(CacheMode.IGNORE); String id = (String)session.save(obj); return id; } }</span> 
                                                    </div> 
                                                    <p style="margin: 10px 0 0 0">);<br /> } catch (JDBCException e) </p> { log.error(e.getLocalizedMessage()); } catch (HibernateException e) { log.error(e.getLocalizedMessage()); } 
                                                    <p style="margin: 10px 0 0 0"> finally </p> { // } 
                                                    <p style="margin: 10px 0 0 0"> return id;<br /> }</p>
                                                </li> 
                                            </ul> 
                                            <p style="margin: 10px 0 0 0">Note: The object we are persisting has is object A -&gt; collections of Y's -&gt; Y has a collections of Z's.</p> 
                                            <p style="margin: 10px 0 0 0">We pass object A to saveBatch method...</p> 
                                            <p style="margin: 10px 0 0 0">Hibernate mapping:</p> 
                                            <p style="margin: 10px 0 0 0">A mapping:</p> 
                                            <p style="margin: 10px 0 0 0">&lt;?xml version=&quot;1.0&quot;?&gt;<br /> &lt;!DOCTYPE hibernate-mapping PUBLIC<br /> &quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&quot;<br /> &quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&quot;&gt;<br /> &lt;hibernate-mapping package=&quot;com.x.y&quot;&gt;<br /> &lt;class name=&quot;A&quot; table=&quot;A&quot;&gt;<br /> &lt;cache usage=&quot;read-write&quot; /&gt;<br /> &lt;id name=&quot;id&quot; length=&quot;36&quot; column=&quot;id&quot;&gt;<br /> &lt;generator class=&quot;org.hibernate.id.GUIDGenerator&quot; /&gt;<br /> &lt;/id&gt;<br /> &lt;set name=&quot;Y&quot; table=&quot;A_Y&quot; cascade=&quot;all-delete-orphan&quot; lazy=&quot;false&quot; inverse=&quot;false&quot; fetch=&quot;select&quot;&gt;<br /> &lt;cache usage=&quot;read-write&quot; /&gt;<br /> &lt;key column=&quot;id&quot; not-null=&quot;true&quot; update=&quot;false&quot;/&gt;<br /> &lt;many-to-many column=&quot;y_id&quot; class=&quot;Y&quot; /&gt;<br /> &lt;/set&gt; <br /> &lt;/class&gt;<br /> &lt;/hibernate-mapping&gt;</p> 
                                            <p style="margin: 10px 0 0 0">Y mapping:</p> 
                                            <p style="margin: 10px 0 0 0">&lt;?xml version=&quot;1.0&quot;?&gt;<br /> &lt;!DOCTYPE hibernate-mapping PUBLIC<br /> &quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&quot;<br /> &quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&quot;&gt;<br /> &lt;hibernate-mapping package=&quot;com.x.y&quot;&gt;<br /> &lt;class name=&quot;Y&quot; table=&quot;Y&quot;&gt;<br /> &lt;cache usage=&quot;read-write&quot; /&gt;<br /> &lt;id name=&quot;id&quot; length=&quot;36&quot; column=&quot;id&quot;&gt;<br /> &lt;generator class=&quot;org.hibernate.id.GUIDGenerator&quot; /&gt;<br /> &lt;/id&gt;<br /> &lt;set name=&quot;properties&quot; lazy=&quot;false&quot; cascade=&quot;all-delete-orphan&quot; inverse=&quot;false&quot;&gt;<br /> &lt;cache usage=&quot;read-write&quot; /&gt;<br /> &lt;key column=&quot;Y_id&quot; not-null=&quot;true&quot; update=&quot;true&quot;/&gt;<br /> &lt;one-to-many class=&quot;Property&quot; /&gt;<br /> &lt;/set&gt; <br /> &lt;/class&gt;<br /> &lt;/hibernate-mapping&gt;</p> 
                                            <p style="margin: 10px 0 0 0">Property mapping:</p> 
                                            <p style="margin: 10px 0 0 0">&lt;?xml version=&quot;1.0&quot;?&gt;<br /> &lt;!DOCTYPE hibernate-mapping PUBLIC<br /> &quot;-//Hibernate/Hibernate Mapping DTD 3.0//EN&quot;<br /> &quot;http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd&quot;&gt;<br /> &lt;hibernate-mapping package=&quot;com.sensorlogic.device&quot;&gt;<br /> &lt;class name=&quot;Property&quot; table=&quot;property&quot;&gt;<br /> &lt;cache usage=&quot;read-write&quot; /&gt;<br /> &lt;id name=&quot;id&quot; length=&quot;36&quot; column=&quot;id&quot;&gt;<br /> &lt;generator class=&quot;org.hibernate.id.GUIDGenerator&quot; /&gt;<br /> &lt;/id&gt;<br /> &lt;many-to-one name=&quot;Y&quot; class=&quot;Y&quot; column=&quot;Y_id&quot; update=&quot;false&quot; insert=&quot;false&quot;/&gt;<br /> &lt;/class&gt;<br /> &lt;/hibernate-mapping&gt;</p> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <tr> 
                            <td class="email-content-main mobile-expand " style="padding: 0px; border-collapse: collapse; border-left: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #fff"> 
                                <table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
                                    <tr> 
                                        <td id="actions-pattern-container" valign="middle" style="padding: 0px; border-collapse: collapse; padding: 10px 0 10px 24px; vertical-align: middle; padding-left: 0"> 
                                            <table align="left" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                                <tr> 
                                                    <td class="actions-pattern-action-icon-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0px; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HHH-9070#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none"> <img class="actions-pattern-action-icon-image" src="cid:jira-generated-image-static-comment-icon-5ef7d11e-1d4d-4c0e-a9a8-7cd17871eea2" alt="Add Comment" title="Add Comment" height="16" width="16" border="0" style="vertical-align: middle" /> </a> 
                                                    </td> 
                                                    <td class="actions-pattern-action-text-container" style="padding: 0px; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 4px; padding-left: 5px"> <a href="https://hibernate.atlassian.net/browse/HHH-9070#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none">Add Comment</a> 
                                                    </td> 
                                                </tr> 
                                            </table> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                        <!-- there needs to be content in the cell for it to render in some clients --> 
                        <tr> 
                            <td class="email-content-rounded-bottom mobile-expand" style="padding: 0px; border-collapse: collapse; color: #fff; padding: 0 15px 0 16px; height: 5px; line-height: 5px; background-color: #fff; border-top: 0; border-left: 1px solid #ccc; border-bottom: 1px solid #ccc; border-right: 1px solid #ccc; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; mso-line-height-rule: exactly">
                                &nbsp;
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
            <tr> 
                <td id="footer-pattern" style="padding: 0px; border-collapse: collapse; padding: 12px 20px"> 
                    <table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                        <tr> 
                            <td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0px; border-collapse: collapse; color: #999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px">
                                 This message was sent by Atlassian JIRA <span id="footer-build-information">(v6.4-OD-02-003#64000-<span title="c12ebbcd8fcc903510487eeeffbf170200b272ad" data-commit-id="c12ebbcd8fcc903510487eeeffbf170200b272ad}">sha1:c12ebbc</span>)</span> 
                            </td> 
                            <td id="footer-pattern-logo-desktop-container" valign="top" style="padding: 0px; border-collapse: collapse; padding-left: 20px; vertical-align: top"> 
                                <table style="border-collapse: collapse; mso-table-lspace: 0pt; mso-table-rspace: 0pt"> 
                                    <tr> 
                                        <td id="footer-pattern-logo-desktop-padding" style="padding: 0px; border-collapse: collapse; padding-top: 3px"> <img id="footer-pattern-logo-desktop" src="cid:jira-generated-image-static-footer-desktop-logo-186e9560-f941-475c-9c58-1b0da837d634" alt="Atlassian logo" title="Atlassian logo" width="169" height="36" class="image_fix" /> 
                                        </td> 
                                    </tr> 
                                </table> 
                            </td> 
                        </tr> 
                    </table> 
                </td> 
            </tr> 
        </table>   
    </body>
</html>