-->
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: How to handle loading of object agregates?
PostPosted: Thu May 22, 2008 11:15 am 
Regular
Regular

Joined: Sun Sep 30, 2007 7:51 pm
Posts: 93
Hi All!

I have a question, that will maybe sound silly. But I would like to know, how you handle loading of an aggregate object, object that has some child objects etc, tree structure, cycle etc. in read-committed transaction level.

Because, I have a problem to load it, and I haven't found the way to make it easier using hibernate.

Here is the problem
environment:
- very high concurrency
- read-committed transaction level
- object aggregates with lot of child objects in collections and other relations (mostly lazy, cannot be eager - multiple bags)

T1 is loading the object aggregate, loads the root object

T2 is committing the very same root object.

T1 now loads child objects (lazy, cache, or whatever). But, because of read-committed level, child objects are different than in time the T1 started. Because of T2 commit.

So hibernate will loaded in general mixed aggregate, some old data, some new.

Well, I know that the T1 would fail on optimistic exception on commit. But, the problem is that code is quite complicated, and we await, that the aggregate is correct. However, after this bad load, the code can fail on many places, as the object structure is in inconsistent state.

Has anyone similar problem?

Our handling is so, that we must use a checksum when loading the aggregate entity, and calculate it again before save (versions of all child objects). But is there some way hibernate could handle this? Best using JPA.

Thanx for any reply :-).
pavol


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.