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.  [ 3 posts ] 
Author Message
 Post subject: locking issues for large volume web application
PostPosted: Mon Mar 03, 2008 9:54 pm 
Newbie

Joined: Tue Jun 28, 2005 11:11 am
Posts: 13
Location: St. Louis, Missouri, USA
First of all, this isn't a Hibernate issue. It's prolly a user issue and that's me :)

I have a large volume web application with about 80k concurrent users during our 5 hour window of operation. I see a lot of errors in the logs regarding HibernateOptimisticLockingFailureException (StaleStateException, StaleObjectStateException). I'm curious if there is anything I can do to reduce the amount of locking problems that I am seeing. We don't see any problems with a small number of users; it is only when we get high volumes that we see these.

Would adjusting the transaction isolation level from rr to say cs improve things? Is there something in my mapping I can tweak? All of my classes have the unsaved-value attribute set for either null or default for id fields.

I'm using Hibernate 3.1.3 with mainframe z/os db2 (type 2 drivers) and was 6.0.x.x. I'm kinda new to a lot of the transaction and locking stuff since I never had any problems before with it. Any information can help :)


Top
 Profile  
 
 Post subject: Re: locking issues for large volume web application
PostPosted: Mon Mar 03, 2008 10:15 pm 
Expert
Expert

Joined: Wed Apr 11, 2007 11:39 am
Posts: 735
Location: Montreal, QC
Umm, you can't do much about the optimistic locking issue since it shows concurrent modifications, and that has something to do with your app data and the way users update data in your database. You could definitely work around this by partitioning your data. That is, if you have data A which has parts B and C then you might want to split A into B and C so that users less likely run into a race for updating data.

For transaction isolation I would say that's not a good idea because it will make your life even harder. You could definitely look into a less restrictive isolation level but you should make sure that won't break anything in your app.

In any events, the key here is to minimize the need for a lock and normalizing your database in a way that in most of your use cases concurrent modifications become impossible. You should also look into decreasing the amount of time a transaction is active. In addition, read an entity very close to when it should be updated.


Farzad-


Top
 Profile  
 
 Post subject:
PostPosted: Mon Mar 03, 2008 10:45 pm 
Newbie

Joined: Tue Jun 28, 2005 11:11 am
Posts: 13
Location: St. Louis, Missouri, USA
Hmm, I can take a look at partitioning my data better. Just off the cuff I have a couple ideas on how I can test your suggestion.

For transaction isolation, that seems to be what I've heard. However our mainframe dbas are starting to really yell at us to set the isolation to cs (mips usage on locking -- don't ask). I didn't feel comfortable with it but it seemed like an outside shot.

Thanks for the suggestions, I'll see what happens!


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