tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pid <...@pidster.com>
Subject Re: synchronizing in tomcat
Date Tue, 17 Nov 2009 16:25:25 GMT
On 17/11/2009 15:43, David BalaĹžic 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).

The term you are looking for is "transaction".  GIYF.


p



> Regards,
> David
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message