How would you do it in a non-servlet environment?

Exactly the same works here too.

regards
Leon

On Tue, Nov 17, 2009 at 4:43 PM, David Balažic <[email protected]> wrote:
> Hi!
>
> Does tomcat offer any mechanism for locking servlet executions?
>
> So if one servlet does:
>  - get 10 EUR from account 1 (read account 1 balance; substract 10;
> store new balance)
>  - add 10 EUR to account 2 (...)
>
> How can I make sure no other servlet does (read account 1 balance;
> sustract 10; store new balance) at the same
> time and cause lost account money?
>
> The account data is in a database, accessed over hibernate (or
> directly, if needed).
>
> Regards,
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to