-->
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: Versioning and transaction advise
PostPosted: Sat Sep 06, 2003 12:40 am 
Regular
Regular

Joined: Fri Sep 05, 2003 12:01 am
Posts: 80
Location: Bogot
Hi all! Im looking for some advice:

Automatic versioning is easy to configure and works great (I get the StaleObjectException when I should). Trouble is I've designed an app which has high concurrency and Im not sure if optimistic locking is the way to go...

I have a an object graph of three different objetcts A->B->C ( -> denotes composition) and the objects in C are the ones that are transaction intensive.

Should I make a separate DAO for C? Or is it fine just to have a DAO for A and use cascade="all" for the relationships?

At the beginning I thought of just having a DAO for A, store it in a session (like the various sessions, one persistent object approach to optimistic locking). The problem with this approach is that when a version conflict occurrs I'm forced to rollback, load the object again from the db (i.e load) and then add the changes... Ouch... (not to mention de performance drawback, but its something we can live with for the size of A).

Is this the way to handle versioned data when a conflict occurs?

If I have a separate DAO for C... then I'll have to write the whole darn thing again... ouch...

Thoughts, ideas are welcome!

_________________
Mauricio Hern


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.