-->
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: Merge problem - UnresolvedEntityInsertActions
PostPosted: Fri Apr 19, 2013 2:19 pm 
Newbie

Joined: Fri Apr 19, 2013 1:51 pm
Posts: 1
Hello,

I'm new to Hibernate so please help me solve this problem.

I'm using one session to read an object and another to save it in DB (this is a business case I can't change, I tested to save with the first session directly and it's OK).

So I need to merge the object to the second session, but it's not working. I get 'UnresolvedEntityInsertActions'.

Here is a part of the code which seems problematic :

Code:
@Entity
@Table(name = "mr_tm_financial_data")
@SequenceGenerator(allocationSize = 1, initialValue = 1, name = "mr_tm_financial_data_id_seq", sequenceName = "mr_tm_financial_data_id_seq")
public class TimeMaterialFinancialData implements Serializable {
...
    @ManyToOne
    @JoinColumn(name = "contractSignatureId", referencedColumnName = "id", nullable = false)
    private ContractSignature contractSignature;
...



And here is a warning I see in the log :

WARN UnresolvedEntityInsertActions - HHH000437: Attempting to save one or more entities that have a non-nullable association with an unsaved transient entity. The unsaved transient entity must be saved in an operation prior to saving these dependent entities.
Unsaved transient entity: ([com.mr.model.finance.ContractSignature#0])
Dependent entities: ([[com.mr.model.finance.TimeMaterialFinancialData#78]])
Non-nullable association(s): ([com.mr.model.finance.TimeMaterialFinancialData.contractSignature])

Could you please explain me why it's working with one session, and not with two when I do a merge operation ? Do you think a mapping change will solve the problem ?

Thanks


Top
 Profile  
 
 Post subject: Re: Merge problem - UnresolvedEntityInsertActions
PostPosted: Sun Apr 21, 2013 6:57 am 
Regular
Regular

Joined: Wed Apr 10, 2013 1:02 am
Posts: 50
Hey man from where you are reading data .. Can u show session code

_________________
Regards
Akash Miital
http://akash.thegrassroots.co.in/hibernate/


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.