-->
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: Object Graph - Concurrency Issues
PostPosted: Thu Aug 13, 2009 7:21 am 
Newbie

Joined: Wed Feb 20, 2008 8:08 pm
Posts: 10
Hi,

our current application retrieves an object graph from the database and sends this down to the client. In our case it is a person the person has associated addresses. We retrieve all of that information effectively putting a lock on anything associated with a person, if the person gets updated then all the associated addresses are marked dirty and get updated even if they were not updated.

This has the potential to cause concurrency issues as the address maintenance is on a different screen from the person detail maintenance i.e. one person could try to update the addresses when another is updating a person (maybe this is unlikely).

What is the best practice in this situation? We are using DTOs to send up and down the wire, then hooking them up to the actual domain objects each time.

Thanks,

B


Top
 Profile  
 
 Post subject: Re: Object Graph - Concurrency Issues
PostPosted: Thu Aug 13, 2009 9:23 am 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
Use "Optimistick Locking", a pattern to solve this.
Hibernate supports it, you won't have to write code, nor do checks for dirty data nor manage locking issues, just enable it and add the version field to the relevant entities.

http://docs.jboss.org/hibernate/stable/core/reference/en/html/transactions.html#transactions-optimistic

_________________
Sanne
http://in.relation.to/


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.