Logo 
Search:

Java Answers

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds
  Question Asked By: Gin Tanaka   on Jun 27 In Java Category.

  
Question Answered By: Viola Hanson   on Jun 27

The question  you have asked, falls into a very interesting area of
enterprise applications: Concurrency Management.

There are various good  resources you can study to get the idea like Martin
Fowler's master-peace at: http://martinfowler.com/eaaCatalog/ and Sun's
J2EE/EJB patterns catalog.

If you want a quick answer, I would say that both locking strategies you
have asked are feasible. They are know as 'Optimistic' and 'Pessimistic'
locking strategies.

Each enterprise, based on its requirement and scenario, generally uses one
of these two locking systems (Although there are other strategies too).

If the opportunity to fall into a transaction rollback is high - based on
your system  flow - then pessimistic lock  is better. Other wise try to use
optimistic lock (let every thing happen, unless sth. bad happens - UNIX
like way of thinking:) every where possible (for your system, sth. like
option 3 then).

Share: 

 

This Question has 9 more answer(s). View Complete Question Thread

 
Didn't find what you were looking for? Find more on online shopping system scenario/analysis Or get search suggestion and latest updates.