[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-7206) NaturalIdLoadAccess: NaturalId synchronization with no need to flush at all

Steve Ebersole (JIRA) noreply at atlassian.com
Mon Apr 2 13:08:49 EDT 2012


    [ https://hibernate.onjira.com/browse/HHH-7206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46144#comment-46144 ] 

Steve Ebersole commented on HHH-7206:
-------------------------------------

Another of the issues with long conversations (any time you have large numbers of stuff in the persistence context really) is the amount of time needed to process dirtiness calculation related to flushes.  And here you are basically doing a throw away dirty calculation.  You calculate the dirtiness and if dirty you update the natural-id xrefs but then just throw away the calculation.  This is the concern I was addressing.  And you can in fact write just the natural-id changes to the database.  The other changes you mentioned would be discovered by dirtiness later and written during flush.  

To be honest, I would never handle natural-id mutation in-line with other use-cases.  Thats asking for trouble IMO.  So this use-case is foreign to me.  Its ok with me, I guess, to not do the write.  As long as you realize the stylistic choice you are making and understand the performance impact its really up to you as the app developer.  As long as Hibernate maintains correctness its really not important.

> NaturalIdLoadAccess: NaturalId synchronization with no need to flush at all
> ---------------------------------------------------------------------------
>
>                 Key: HHH-7206
>                 URL: https://hibernate.onjira.com/browse/HHH-7206
>             Project: Hibernate ORM
>          Issue Type: Improvement
>          Components: core
>    Affects Versions: 4.1.1
>         Environment: Hibernate4, database-independent
>            Reporter: Guenther Demetz
>              Labels: flush, naturalId
>
> With few code changes I think it is possible to make NaturalIdLoadAccess work with no need to rely on flush at all,
> please see following comments.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list