Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
SCJP, SCJD, SCWCD, SCBCD
"I'm not back." - Bill Harding, Twister
"I'm not back." - Bill Harding, Twister
Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
Synchronizing in a block and controlling your increments from in there is, IMO, the safest, easiest bug-free implementation that you can go with.
Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
In the scenario given in the assignment, the accomodation or contractor or whatever is not a big list, to have two client to book for the same record ID is very high. If your cookie generation algorithm has a possibility whatever formula you use which gives the same cookie for two booking to the same resource, your synchronization and locking mechanism will collapse. Uniqueness is of utmost importance here.
Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
Jacques<br />*******<br />MCP, SCJP, SCJD, SCWCD
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime. |