<!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/c32c4103dacf291cdfa0439e34f2c07e?s=48&amp;d=https%3A%2F%2Fsecure.gravatar.com%2Favatar%2Fc32c4103dacf291cdfa0439e34f2c07e%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="gbadner" id="email_gbadner" href="https://hibernate.atlassian.net/secure/ViewProfile.jspa?name=gbadner" style="color:#6c797f;; color: #3b73af; text-decoration: none">Gail Badner</a> <strong>commented</strong> on <a href="https://hibernate.atlassian.net/browse/HHH-11124" style="color: #3b73af; text-decoration: none"><img src="cid:jira-generated-image-avatar-d0ed0489-89a8-45a4-9b94-b7cec350734e" height="16" width="16" border="0" align="absmiddle" alt="Improvement"> HHH-11124</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-11124" style="color: #3b73af; text-decoration: none">Re: OneToOne level 2 caching limitation</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"> <p style="margin: 10px 0 0; margin-top: 0"><span class="error">[5:44 PM]</span> Gail Badner: @SteveEbersole , btw, I'm looking at NaturalIdXrefDelegate to see if I can extract/extend some functionality for FK used by logical one-to-one associations<br> <span class="error">[5:45 PM]</span> Steve Ebersole: its a lot if the association is mutable<br> <span class="error">[5:47 PM]</span> Gail Badner: yeah; one thing I was thinking about was allowing the application to set setSynchronizationEnabled( false ) somehow when calling Query#iterate or Query#scroll<br> <span class="error">[5:49 PM]</span> Gail Badner: also, if the association has updatable="false", it is effectively immutable<br> <span class="error">[5:49 PM]</span> Gail Badner: ^^^ @SteveEbersole<br> <span class="error">[5:51 PM]</span> Steve Ebersole: yes, i understand that.. but i am talking about the (default) case where updatable="true"<br> <span class="error">[5:51 PM]</span> Steve Ebersole: I'm really not a fan of this Query#iterate or Query#scroll thing<br> <span class="error">[5:53 PM]</span> Steve Ebersole: one option is to support this just for immutable associations<br> <span class="error">[5:53 PM]</span> Steve Ebersole: for the first cut<br> <span class="error">[5:53 PM]</span> Gail Badner: an alternative is to have Session#setOneToOneFKSynchronizationEnabled<br> <span class="error">[5:54 PM]</span> Gail Badner: and be able to set it before/after calling Query#getResultList<br> <span class="error">[5:55 PM]</span> Steve Ebersole: why doesn't this just fall under normal flush-mode handling?<br> <span class="error">[5:55 PM]</span> Gail Badner: it looks like a lot of the logic for mutable natural IDs applies<br> <span class="error">[5:55 PM]</span> Steve Ebersole: i really don't like any of these options<br> <span class="error">[5:55 PM]</span> Steve Ebersole: yes, but load-by-id is always a single load<br> <span class="error">[5:56 PM]</span> Steve Ebersole: yes, i agree.... most of NaturalIdXrefDelegate can be reused here<br> <span class="error">[5:56 PM]</span> Steve Ebersole: probably even reused if we make it sufficiently abstract<br> <span class="error">[5:57 PM]</span> Gail Badner: the problem is when the association on the mappedBy side is initialized; that can happen while an application iterates the List returned by Query#getResultList<br> <span class="error">[5:58 PM]</span> Gail Badner: yeah, I think I can extract an superclass<br> <span class="error">[5:59 PM]</span> Gail Badner: part of <span class="jira-issue-macro" data-jira-key="HHH-11124"> <a href="https://hibernate.atlassian.net/browse/HHH-11124" class="jira-issue-macro-key issue-link" title="OneToOne level 2 caching limitation" style="color: #3b73af; text-decoration: none"> <img class="icon" src="https://hibernate.atlassian.net/secure/viewavatar?size=xsmall&amp;avatarId=12150&amp;avatarType=issuetype"> HHH-11124 </a> <span class="aui-lozenge aui-lozenge-subtle aui-lozenge-complete jira-macro-single-issue-export-pdf" style="background: #cccccc; border: 1px solid #cccccc; border-radius: 3px; color: #333333; display: inline-block; font-size: 11px; font-weight: bold; line-height: 99%; margin: 0; padding: 2px 5px; text-align: center; text-decoration: none; text-transform: uppercase; background-color: #ffffff; border-color: #cccccc; color: #333333" bgcolor="#ffffff">Open</span> </span> is to cache entities by the one-to-one FK; I'm not crazy about doing that<br> <span class="error">[5:59 PM]</span> Gail Badner: but caching in the Session help a lot<br> <span class="error">[6:01 PM]</span> Steve Ebersole: I'm quite against shared caching<br> <span class="error">[6:01 PM]</span> Steve Ebersole: here<br> <span class="error">[6:01 PM]</span> Steve Ebersole: so we agree there<br> <span class="error">[6:02 PM]</span> Gail Badner: I don't think it's worth it for mutable associations for sure<br> <span class="error">[6:02 PM]</span> Steve Ebersole: for immutable we really dont even need to involve caching<br> <span class="error">[6:03 PM]</span> Gail Badner: 2lc?<br> <span class="error">[6:03 PM]</span> Steve Ebersole: a simple SF-scope ConcurrentHashMap is more than enough<br> <span class="error">[6:03 PM]</span> Gail Badner: oh, interesting<br> <span class="error">[6:03 PM]</span> Steve Ebersole: its read-only, no need for locking<br> <span class="error">[6:03 PM]</span> Steve Ebersole: simplest thing that works<br> <span class="error">[6:04 PM]</span> Steve Ebersole: and doesn't change SPIs <img class="emoticon" src="cid:jira-generated-image-static-wink-fbe847bd-1c1c-43ec-9780-e914e98c1f1d" height="16" width="16" align="absmiddle" alt="" border="0"><br> <span class="error">[6:04 PM]</span> Gail Badner: is that done with immutable natural IDs?<br> <span class="error">[6:04 PM]</span> Steve Ebersole: we do cache those in the second level cache<br> <span class="error">[6:04 PM]</span> Steve Ebersole: but thats different<br> <span class="error">[6:05 PM]</span> Steve Ebersole: tbh, I'm not even sure the ConcurrentHashMap thing is even needed<br> <span class="error">[6:05 PM]</span> Steve Ebersole: just saying, if we do end up "shared caching" them, no need to get all full blown and use l2c<br> <span class="error">[6:06 PM]</span> Steve Ebersole: i'd not even bother for mutable fks<br> <span class="error">[6:06 PM]</span> Gail Badner: really all we need to cache is the FK -&gt; PK; then load from cache by PK<br> <span class="error">[6:06 PM]</span> Gail Badner: oh, that was kinda ambiguous<br> <span class="error">[6:07 PM]</span> Gail Badner: really all we need to cache is the FK -&gt; PK (in SF); then load from 2lc cache by PK<br> <span class="error">[6:07 PM]</span> Steve Ebersole: i understand what you need to do <img class="emoticon" src="cid:jira-generated-image-static-wink-fbe847bd-1c1c-43ec-9780-e914e98c1f1d" height="16" width="16" align="absmiddle" alt="" border="0"><br> <span class="error">[6:07 PM]</span> Steve Ebersole: i'm questioning the usefulness<br> <span class="error">[6:08 PM]</span> Gail Badner: ok, I'm making sure I understand what I need to do <img class="emoticon" src="cid:jira-generated-image-static-smile-9a3d6ea5-40df-4630-9db6-972ef55f3277" height="16" width="16" align="absmiddle" alt="" border="0"><br> <span class="error">[6:08 PM]</span> Steve Ebersole: cache in Session... meh<br> <span class="error">[6:08 PM]</span> Steve Ebersole: that has a huge potential to increase the size of the session with potentially no benefit<br> <span class="error">[6:08 PM]</span> Gail Badner: how would it be read-only in SF?<br> <span class="error">[6:08 PM]</span> Steve Ebersole: ?<br> <span class="error">[6:09 PM]</span> Gail Badner: you said something above...<br> <span class="error">[6:09 PM]</span> Steve Ebersole: how would immutable fks be read-only?<br> <span class="error">[6:09 PM]</span> Steve Ebersole: that seems self-evident <img class="emoticon" src="cid:jira-generated-image-static-wink-fbe847bd-1c1c-43ec-9780-e914e98c1f1d" height="16" width="16" align="absmiddle" alt="" border="0"><br> <span class="error">[6:09 PM]</span> Gail Badner: "its read-only, no need for locking"<br> <span class="error">[6:09 PM]</span> Steve Ebersole: yep, we were talking about immutable fks<br> <span class="error">[6:10 PM]</span> Steve Ebersole: 1-&gt;2 is always 1-&gt;2<br> <span class="error">[6:10 PM]</span> Gail Badner: oh, ok; I thought that was about the Map in SF<br> <span class="error">[6:10 PM]</span> Steve Ebersole: thats the meaning of immutable<br> <span class="error">[6:10 PM]</span> Steve Ebersole: that is what I mmeant<br> <span class="error">[6:10 PM]</span> Gail Badner: wimi, entries have to be added to the Map<br> <span class="error">[6:10 PM]</span> Gail Badner: so the Map isn't read-oly<br> <span class="error">[6:11 PM]</span> Steve Ebersole: of course it is<br> <span class="error">[6:11 PM]</span> Steve Ebersole: you never over-write<br> <span class="error">[6:11 PM]</span> Steve Ebersole: just like @Immutable does not stop insertions<br> <span class="error">[6:11 PM]</span> Gail Badner: well, it's possible that it could be added by 2 sessions<br> <span class="error">[6:11 PM]</span> Steve Ebersole: and thats bad how?<br> <span class="error">[6:11 PM]</span> Gail Badner: they'd be adding the same thing<br> <span class="error">[6:11 PM]</span> Steve Ebersole: exactly<br> <span class="error">[6:12 PM]</span> Steve Ebersole: so locking would accomplish what?<br> <span class="error">[6:12 PM]</span> Gail Badner: ok, I see<br> <span class="error">[6:12 PM]</span> Steve Ebersole: just let them each suceed<br> <span class="error">[6:12 PM]</span> Steve Ebersole: nothing to see, move along<br> <span class="error">[6:13 PM]</span> Steve Ebersole: but again... this has the potential to grow (and grow)<br> <span class="error">[6:14 PM]</span> Gail Badner: well I suppose it could be some other kind of map that gets rid of last used entries<br> <span class="error">[6:14 PM]</span> Steve Ebersole: not sure how we would measure the benefit of this cache versus not caching<br> <span class="error">[6:14 PM]</span> Steve Ebersole: sure which also has ovverhead<br> <span class="error">[6:15 PM]</span> Gail Badner: the DB can end up getting hit a lot more<br> <span class="error">[6:15 PM]</span> Gail Badner: w/o caching FK -&gt; PK<br> <span class="error">[6:15 PM]</span> Steve Ebersole: sure and generally there is ann index for resolution by that FK<br> <span class="error">[6:15 PM]</span> Steve Ebersole: dont be so sure its always faster to cache these<br> <span class="error">[6:16 PM]</span> Steve Ebersole: its like anything we cache... there is an overhead involved in the cachign itself<br> <span class="error">[6:16 PM]</span> Gail Badner: is this something that should be enabled?<br> <span class="error">[6:16 PM]</span> Steve Ebersole: but in general, i agree that there are a lot of similarities with natural-id x-refing<br> <span class="error">[6:17 PM]</span> Steve Ebersole: good question<br> <span class="error">[6:17 PM]</span> Steve Ebersole: not sure<br> <span class="error">[6:17 PM]</span> Steve Ebersole: probably</p> </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-11124?inbox=true&focusedCommentId=101711&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-101711",
    "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-11124#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-b5aa678b-df6e-4739-ac81-41aea79383d2" 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-11124#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">(v1001.0.0-SNAPSHOT#100082-<span title="d026f231549fbdf4a885f719d8dfddcb20bec09c" data-commit-id="d026f231549fbdf4a885f719d8dfddcb20bec09c}">sha1:d026f23</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; opacity: 0.150"> <img id="footer-pattern-logo-desktop" src="cid:jira-generated-image-static-footer-desktop-logo-9c1c6148-00e4-419b-b680-2745f257ebc4" alt="Atlassian logo" title="Atlassian logo" width="192" height="24" class="image_fix"> </td> 
                                                </tr> 
                                            </tbody>
                                        </table> </td> 
                                </tr> 
                            </tbody>
                        </table> </td> 
                </tr> 
            </tbody>
        </table>   
    
<img src="https://u4043402.ct.sendgrid.net/wf/open?upn=YNXLe5Uzuivj8jGpuXra04BSJ-2BS7raa1puTAtyVUP-2F0UG25sB-2BHToWWBMcbXwnNUGC1BxU7ZjFvI9pNKbsAgqYxQYrHoAIzP262IrHyimwgsSH5lZ5FF5Rgpk7AcFljqk6JJAetnJtYREmbTAJx5Q9o2laRQWmpdLQfDaFmGnd1AlN2M8qBBjVdqH1us9GNRrgJcUsLYtJYL-2FvznBPmnXQ-2F2wTvatuZA7reAVOpTuOvbDWdgTgbSuzlGz0RRcjCdjJFtI1-2FjG-2Fyc9Sq-2Byy-2B-2FF79ybUX9snisJJuK3EJHKd9AywU1yKL26kcS9O2oNCDEF2exiCmxXodlcr7bOuR4rLt6aqD8wUeRm39Z8c8xDes1rQzWkrw4h6-2FfbflHEQBfevmojfXBNzzFDzmNlhl0GZVwPuWw4HyPOTn1GIcqBd7a3jcN4NDgXwFWRG-2BdDeuE" alt="" width="1" height="1" border="0" style="height:1px !important;width:1px !important;border-width:0 !important;margin-top:0 !important;margin-bottom:0 !important;margin-right:0 !important;margin-left:0 !important;padding-top:0 !important;padding-bottom:0 !important;padding-right:0 !important;padding-left:0 !important;"/>
</body>
</html>