-->
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.  [ 4 posts ] 
Author Message
 Post subject: transaction problem when using multiple servers
PostPosted: Tue Dec 19, 2006 1:08 pm 
Beginner
Beginner

Joined: Tue Dec 19, 2006 12:55 pm
Posts: 27
Hi all,

We have a webapp based on hibernate, we have several servers on
different machines running this webapp and we have encountered that
transactions don't span multiple servers, if i have two transactions (in different servers) updating the same table i obtain a mix of both updates. What must i do?

Thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 19, 2006 3:42 pm 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Which mode are you using? Optimistic of pessimistic one? Are you using versions? What do you call a "mix of both updates"?

Did you read this chapter: http://www.hibernate.org/hib_docs/v3/re ... ansactions

About pessimistic locking:
http://www.hibernate.org/hib_docs/v3/re ... ns-locking

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 5:55 am 
Beginner
Beginner

Joined: Tue Dec 19, 2006 12:55 pm
Posts: 27
Thanks for your answer, i'm pretty sure we are using optimistic locking, what must i do to enable pessimistic locking? is it related with the configuration of hibernate? can it be configured in a single point?

Thanks in advance


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 20, 2006 6:52 am 
Beginner
Beginner

Joined: Tue Dec 19, 2006 12:55 pm
Posts: 27
I forgot to include this before. Each transaction we issue deletes
a group of records from a table and then insert records on the same table,
when both transactions end, i find a mix of records inserted from each
transaction, i would like to keep only the records from one of the two transactions.

Greets and thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 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.