In my web-service i have a user table which contains column called “HITS”,now as a user in this user class/table consumes the web-service,”HITS” count is incremented by 1.which involves write operation and hence comes in optimistic/pessimistic locks.
Issue am facing is high concurrency scenario,in which 100 hits come simultaneously for same user.
Can anyone suggest me a strategy to avoid delays caused by locking a user row to update “HITS” when web-service is used simultaneously from same user’s account ?
OR
you can also suggest a way to update some variable which i can monitor after every 12 hours,to generate the “HITS” value,by summing up the variable(s) or something like that ?
Am using hibernate and EJB stateless session bean.
just insert one record for every hit into table
all_hits…then on some schedule – select from that table, and insert into
hits_summarytable, and delete the originals.