[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6275) Unexpected audit entries when using cascadeType.ALL

Lukasz Antoniak (JIRA) noreply at atlassian.com
Sat Aug 13 07:53:03 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6275?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43230#comment-43230 ] 

Lukasz Antoniak commented on HHH-6275:
--------------------------------------

Amin, please verify whether it is a valid Envers test case: https://github.com/lukasz-antoniak/hibernate-core/commit/0a35b7926ac764508a283c81bd974c273f717443
I've noticed only one INSERT statement to CLASS_B_AUD table (executed during first transaction). The test passes without any errors in branch 4.x build today.
I was unable to reproduce this issue also in branch 3.6.7.

Regards,
Lukasz Antoniak

> Unexpected audit entries when using cascadeType.ALL
> ---------------------------------------------------
>
>                 Key: HHH-6275
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6275
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: envers
>    Affects Versions: 3.6.4
>         Environment: mac os 10.6.7
> java 1.6.0
>            Reporter: Amin Mohammed-Coleman
>         Attachments: hibernate-envers-test.zip
>
>
> I have the following object model
>  
> Class A {
> @OneToMany (cascade=CascadeType.ALL)
>   Set<B> setOfClassB = new HashSet<B>();
>  
> }
>  
> @Audited
> Class B {
>   String name;
>    String value;
>   @ManyToOne(cascade=CascadeType.ALL)
>    @Audited(targetAuditMode = RelationTargetAuditMode.NOT_AUDITED)
>    ClassA belongsTo;
> }
>  
>  
> Everything is ok. I can create an instance of classA with a set of audited classB's.  WHat is interesting is that if i update ClassA with any other data I get an entry update in the audit table for each entity classB saying an update occurred which is not correct as I only updated classA which is not audited.
> Please see http://community.jboss.org/thread/166827?tstart=0, also I have attached a small test case

--
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