-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Hibernate invkoing onFlushDirty for umodified objects in Set
PostPosted: Tue Nov 11, 2014 11:46 am 
Newbie

Joined: Tue Nov 11, 2014 11:41 am
Posts: 1
I have a object with below relationship

public class A {


@Id
@SequenceGenerator(name = "ID_GENERATOR", sequenceName = "Id_SEQ", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "ID_GENERATOR")
@Column(name = "id")
private BigDecimal id;


@OneToMany(mappedBy = MST, orphanRemoval = true, cascade = { CascadeType.ALL})
@OrderBy("id DESC")
private List<B> b = new ArrayList<B>();

@Column(name = "name")
private String name;

}

When I modify class A’S attribute SAY name attribute and say dao.persist(A) using JPA entitymanager then onFlushDirty()[overridden in my Hibernate interceptor] is getting invoked for B object even when it is not modified

I am not understanding why hibernate is treating List<B> objects to be dirty when I am trying to save the parent object A.

In short when i persist Parent A then all childrens are also marked for update .i.e Hibernate Interceptors onFlushDirty() is invoked even when they are not modified


Top
 Profile  
 
 Post subject: Re: Hibernate invkoing onFlushDirty for umodified objects in Set
PostPosted: Mon Jan 25, 2016 4:31 am 
Newbie

Joined: Thu Oct 05, 2006 3:26 am
Posts: 8
Maybe related to this bug?
https://hibernate.atlassian.net/browse/HHH-10236


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.