-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate 4.1.4 fails to save transient/transitive entities
PostPosted: Sat Jun 16, 2012 6:18 am 
Newbie

Joined: Thu Feb 25, 2010 6:48 pm
Posts: 2
Hi,

We recently upgraded one of our applications from Hibernate 3.5 (milestone 1 to be precise ) to 4.1.4 and have noticed several strange issues and I'm wondering if its a behavioral change in Hibernate, or a configuration error on our part.

First up - we're still usig SessionFactory/Sessions rather than JPA/EntityManager.

The first strange thing we've noticed is that atho FlushMode is set to AUTO, it appears we have to manually call session.flush() in order for any changes to actually be saved. When debugging, I can see EntityInsertActions being recorded in the "insertions" field of the ActionQueue, only none of these appear to ever get inserted into the database, I had a thought this may be related to HHH-5472 [1] but none of the EntityInsertActions appear in the unresolved collection.

The second strange thing we're seeing also seems related to unresolved actions, in that we now seem to have to save each and every new Entity we're creating individually, rather than having hibernate cascade the inserts. For example, we have an Agreement entity, which contains a list of AgreementRoles, which in turn contains a PartyRole - all three objects in that tree are created, and we session.save(agreement).

Previously, Hibernate would insert the PartyRole and get an id, then insert the Agreement and get its id, then insert the AgreementRoles with each id ( at least, I assume thats the order it was doing it - I don't see any other way it could ).

Yet now it seems I have to manually save all three, in the correct order - which sounds more "correct", but also seems more.... cumbersome.

Has anyone seem any similar behaviour, or have any pointers to what I should look at for configuring things properly if it sounds like a config problem?

Thanks in advance,
Mar



[1] https://hibernate.onjira.com/browse/HHH-5472


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

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.