Agreed. One word of caution...


At 06:46 PM 10/27/2003, you wrote:
I've had to do this before when credit card processing was being done. A double-click can result in the credit card being charged twice, so you've really got to avoid it.

We actually synchronized on the session for the duration of the processing, and then set a flag in the session once the processing was done. Any subsequent attempts would be flagged as duplicates and you'd just get a results screen.

You aren't guaranteed to have the same HttpSession object for every request -- HttpSession is an interface which is implemented internally and wrapped by a facade. Synchronizing on the actual object you get from req.getSession() can potentially leave you synchronizing on totally different objects.


justin


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to