<!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: #333333; 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: 0; mso-table-rspace: 0; background-color: #f5f5f5; border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0" bgcolor="#f5f5f5"> 
            <!-- header here --> 
            <tbody>
                <tr> 
                    <td id="header-pattern-container" style="padding: 0; border-collapse: collapse; padding: 10px 20px"> 
                        <table id="header-pattern" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                            <tbody>
                                <tr> 
                                    <td id="header-avatar-image-container" valign="top" style="padding: 0; border-collapse: collapse; vertical-align: top; width: 32px; padding-right: 8px" width="32"> <img id="header-avatar-image" class="image_fix" src="https://avatar-cdn.atlassian.com/df12d7792bd3b7be3a4edf12cabd58cb?s=48&amp;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fdf12d7792bd3b7be3a4edf12cabd58cb%3Fd%3Dmm%26s%3D48%26noRedirect%3Dtrue" height="32" width="32" border="0" style="border-radius: 3px; vertical-align: top"> </td> 
                                    <td id="header-text-container" valign="middle" style="padding: 0; 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="steve" id="email_steve" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?name=steve" style="color:#6c797f;; color: #3b73af; text-decoration: none">Steve Ebersole</a> <strong>commented</strong> on <a href="https://hibernate.atlassian.net/browse/HHH-11356" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-avatar-23a26cab-012c-4021-8561-e9d48da004c0" height="16" width="16" border="0" align="absmiddle" alt="Improvement"> HHH-11356</a> </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
                <tr> 
                    <td id="email-content-container" style="padding: 0; 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: 0; mso-table-rspace: 0; border-spacing: 0; border-collapse: separate"> 
                            <tbody>
                                <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: 0; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 15px; background-color: #ffffff; border-left: 1px solid #cccccc; border-top: 1px solid #cccccc; border-right: 1px solid #cccccc; 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" height="10" bgcolor="#ffffff">&nbsp;</td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand " style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> 
                                        <table class="page-title-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                                            <tbody>
                                                <tr> 
                                                    <td style="vertical-align: top;; padding: 0; 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-11356" style="color: #3b73af; text-decoration: none">Re: Adjust the 2nd-Cache SPIs to better reflect supported uses</a> </span> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td id="text-paragraph-pattern-top" class="email-content-main mobile-expand  comment-top-pattern" style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff; border-bottom: none; padding-bottom: 0" bgcolor="#ffffff"> 
                                        <table class="text-paragraph-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 2px"> 
                                            <tbody>
                                                <tr> 
                                                    <td class="text-paragraph-pattern-container mobile-resize-text " style="padding: 0; border-collapse: collapse; padding: 0 0 10px"> 
                                                        <blockquote style="margin: 10px 0 0; margin-top: 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px"> 
                                                            <p style="margin: 10px 0 0; margin-top: 0">Steve Ebersole - I think I agree with all the points above; I don't get what was the problem with timestamps, but the actual implementation seems fine to me.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">Say there is no CTC (no explicit txn). Since timestamp has moved to CTC, how would one access <tt>CTC#getCurrentTransactionStartTimestamp</tt> when CTC is null? That's "the problem with timestamps", to which I suggested a solution.</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px"> 
                                                            <p style="margin: 10px 0 0; margin-top: 0">One point that wasn't clear before is what you mean by 'CTC being aware of transaction boundaries' - if the only thing is that it registers itself as a synchronization (if needed), I am absolutely fine with that. I thought you wanted it to track 'what's the current transaction', which does not seem to be the case.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">This is very far off from what I actually described:</p> 
                                                        <ol> 
                                                            <li>CTC is <b>not</b> a synchronization (assuming you mean a JTA synchronization). Again, there is exactly one synchronization that Hibernate <b>ever</b> registered named, surprisingly, <tt>org.hibernate.resource.transaction.backend.jta.internal.synchronization.RegisteredSynchronization</tt>. As we've discussed multiple times now, CTC is meant to model the current "explicit" transaction context as provided by the cache implementor for it to keep track of whatever resources it deems important for its transactional processing.</li> 
                                                            <li>When I mentioned `CTC being aware of transaction boundaries` it was clearly in relation to one possible implementation of <tt>org.hibernate.engine.spi.SharedSessionContractImplementor#getCurrentCacheTransactionContext</tt> such that this current CTC is never null - thereby always allowing access to a valid timestamp (either when the Session started or when the last explicit transaction ended). This specific quote that you pulled out of that larger context was the option where Session gets the CTC from <tt>RegionFactory#startingTransaction</tt> as soon as it is created and it keeps that same reference until it is closed - that CTC would get callbacks of that transaction ending and do whatever it needs to do to complete the transaction including cleaning up any of these transactional resources to prepare itself for the next transaction. I had assumed it would be obvious that in such a solution that the CTC would "<span class="error">[be]</span> aware of transaction boundaries" since we'd notify it of these boundaries. Again, this is to address the need to access the timestamp even when there is no explicit txn ctx.</li> 
                                                            <li>The other options for this (^^) was to have Session itself be a CTC for cases where there is no explicit txn. If/when an explicit txn is entered we'd get a CTC from the RegionFactory and use that until we leave that txn boundary.</li> 
                                                        </ol> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px"> 
                                                            <p style="margin: 10px 0 0; margin-top: 0">A case that is not currently handled is a transaction suspend/resume - the former should null AbstractSharedSessionContract.cacheTransactionContext and the latter should set it to the CTC belonging to the previously suspended transaction.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">That is true. However Hibernate does not generically handle suspend/resume. It only deals with suspend/resume that it initiates. So generically this is beyond the scope of what we do. And I personally believe it is something we do not want to do.</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px"> 
                                                            <p style="margin: 10px 0 0; margin-top: 0">And one item that you haven't responded upon is that the relation of 2LC and hibernate.connection.isolation setting isn't stated anywhere</p>
                                                        </blockquote> <p style="margin: 10px 0 0">I actually have explained the purpose of the <tt>hibernate.connection.isolation</tt> setting many times, many places. I don't mention it in relation to L2C because there is absolutely no relation. <tt>hibernate.connection.isolation</tt> is used to tell the connection pooling impl what isolation to use - and even then, aside from our built-in impl, there is no guarantee that the pool needs to use it. A DataSource would <b>never</b> use it. Attempting to make some interpretation of what to do based on the value of {[hibernate.connection.isolation}} is completely wrong.</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px"> 
                                                            <p style="margin: 10px 0 0; margin-top: 0">but it's too easy (ehm, or it should be) to turn the slow -&gt; fast knob by enabling caching without verifying application needs. </p>
                                                        </blockquote> <p style="margin: 10px 0 0">I really don't get this argument. The idea that just because "something is there" I, as an app developer, have to use it is silly. And its even more silly to be that developer that believes this. We can't help every silly developer do all the things they should nor to not do all the things they should not.</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px"> 
                                                            <p style="margin: 10px 0 0; margin-top: 0">We've warned users about query cache lag, we should do the same for domain data.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">Um, we do. At every possible place we can. Our docs mention the dangers of enabling caching of any kind without a specific reason. We've mentioned it in wikis, blogs, chats. I'm not sure what else you'd like to see here or where else you think we should document this.</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px"> 
                                                            <p style="margin: 10px 0 0; margin-top: 0">And I think I should withdraw my proposal to make the isolation level an enum</p>
                                                        </blockquote> <p style="margin: 10px 0 0">Right. As you go on to state, this will never work especially considering you want(ed) to tie this to db isolation. <tt>AccessType</tt> (transactional, read-only, etc) imply this to some degree already. </p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px"> 
                                                            <p style="margin: 10px 0 0; margin-top: 0">Steve Ebersole The question that persists: Is there an option to query the current connection isolation level if this is not set in properties? I haven't seen such method in Dialect.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">Well aside from the cautions from both Sanne and I that this is a bad idea, you can get this from <tt>java.sql.Connection#getTransactionIsolation</tt>. But note from the docs for this method that it will miss out on non-ANSI-defined levels unless you rely on non-JDBC-compliant behavior. I am also not sure why Dialect would report this anyway; this can be adjusted per-Connection - so how would Dialect know this?</p> 
                                                        <blockquote style="margin: 10px 0 0; border-left: 1px solid #cccccc; color: #707070; margin-left: 19px; padding: 10px 20px"> 
                                                            <p style="margin: 10px 0 0; margin-top: 0">I would still love to see a 2LC provider TCK (including multi-threaded stress tests), but that could simply check that the provider is capable of serializable isolation, and does not have to test looser semantics.</p>
                                                        </blockquote> <p style="margin: 10px 0 0">Sounds great. Look forward to seeing this as well.</p> <p style="margin: 10px 0 0">Otherwise there is still no replies regarding:</p> 
                                                        <ol> 
                                                            <li>the preferred option for handling <tt>SharedSessionContractImplementor#getCurrentCacheTransactionContext</tt> such that it is always non-null to be able to access timestamp</li> 
                                                            <li>the question of <tt>Region.Name</tt></li> 
                                                        </ol> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                                <tr> 
                                    <td class="email-content-main mobile-expand " style="padding: 0; border-collapse: collapse; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; border-top: 0; border-bottom: 0; padding: 0 15px 0 16px; background-color: #ffffff" bgcolor="#ffffff"> <script type="application/ld+json">
{
  "@context": "http://schema.org",
  "@type": "EmailMessage",
  "description": "View Issue",
  "potentialAction": {
    "@type": "ViewAction",
        "target": "https://hibernate.atlassian.net/browse/HHH-11356?inbox=true&focusedCommentId=99505&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-99505",
    "name": "View Comment"
      },
  "publisher": {
    "@type": "Organization",
    "name": "Atlassian",
    "url": "https://www.atlassian.com"
  }
}
</script> 
                                        <table id="actions-pattern" cellspacing="0" cellpadding="0" border="0" width="100%" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 1px"> 
                                            <tbody>
                                                <tr> 
                                                    <td id="actions-pattern-container" valign="middle" style="padding: 0; border-collapse: collapse; padding: 10px 0 10px 24px; vertical-align: middle; padding-left: 0"> 
                                                        <table align="left" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                                                            <tbody>
                                                                <tr> 
                                                                    <td class="actions-pattern-action-icon-container" style="padding: 0; border-collapse: collapse; font-family: Arial, sans-serif; font-size: 14px; line-height: 20px; mso-line-height-rule: exactly; mso-text-raise: 0; vertical-align: middle"> <a href="https://hibernate.atlassian.net/browse/HHH-11356#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-36992f0d-8427-4d3c-915b-5880af6c7d05" 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: 0; 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-11356#add-comment" target="_blank" title="Add Comment" style="color: #3b73af; text-decoration: none">Add Comment</a> </td> 
                                                                </tr> 
                                                            </tbody>
                                                        </table> </td> 
                                                </tr> 
                                            </tbody>
                                        </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: 0; border-collapse: collapse; color: #ffffff; padding: 0 15px 0 16px; height: 5px; line-height: 5px; background-color: #ffffff; border-top: 0; border-left: 1px solid #cccccc; border-bottom: 1px solid #cccccc; border-right: 1px solid #cccccc; border-bottom-right-radius: 5px; border-bottom-left-radius: 5px; mso-line-height-rule: exactly" height="5" bgcolor="#ffffff">&nbsp;</td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
                <tr> 
                    <td id="footer-pattern" style="padding: 0; border-collapse: collapse; padding: 12px 20px"> 
                        <table id="footer-pattern-container" cellspacing="0" cellpadding="0" border="0" style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                            <tbody>
                                <tr> 
                                    <td id="footer-pattern-mobile-separated-links" class="mobile-resize-text" width="100%" colspan="2" style="padding: 0; border-collapse: collapse; color: #999999; font-size: 12px; line-height: 18px; font-family: Arial, sans-serif; mso-line-height-rule: exactly; mso-text-raise: 2px"> Get JIRA notifications on your phone! Download the JIRA Cloud app for <a href="https://play.google.com/store/apps/details?id=com.atlassian.android.jira.core&amp;referrer=utm_source%3DNotificationLink%26utm_medium%3DEmail" style="color: #3b73af; text-decoration: none">Android</a> or <a href="https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&amp;ct=EmailNotificationLink&amp;mt=8" style="color: #3b73af; text-decoration: none">iOS</a> 
                                        <hr> </td> 
                                </tr> 
                                <tr> 
                                    <td id="footer-pattern-text" class="mobile-resize-text" width="100%" style="padding: 0; border-collapse: collapse; color: #999999; 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">(v1000.1254.0#100059-<span title="0a46c0bdad2beb5f4fcee4428b4d7ab2650448b4" data-commit-id="0a46c0bdad2beb5f4fcee4428b4d7ab2650448b4}">sha1:0a46c0b</span>)</span> </td> 
                                    <td id="footer-pattern-logo-desktop-container" valign="top" style="padding: 0; border-collapse: collapse; padding-left: 20px; vertical-align: top"> 
                                        <table style="border-collapse: collapse; mso-table-lspace: 0; mso-table-rspace: 0"> 
                                            <tbody>
                                                <tr> 
                                                    <td id="footer-pattern-logo-desktop-padding" style="padding: 0; border-collapse: collapse; padding-top: 3px"> <img id="footer-pattern-logo-desktop" src="cid:jira-generated-image-static-footer-desktop-logo-old-e7e567e6-d44e-4699-b640-47c10f38eafa" alt="Atlassian logo" title="Atlassian logo" width="114" height="24" class="image_fix"> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
            </tbody>
        </table>   
    </body>
</html>