Re: synchronizing in tomcat

2009-11-17 Thread Pid
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 d

RE: synchronizing in tomcat

2009-11-17 Thread Joseph Morgan
ne for the DB. -Original Message- From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] Sent: Tuesday, November 17, 2009 10:13 AM To: Tomcat Users List Subject: RE: synchronizing in tomcat > From: Neil Aggarwal [mailto:n...@jammconsulting.com] > Subject: RE: synchro

RE: synchronizing in tomcat

2009-11-17 Thread Caldarale, Charles R
> From: Neil Aggarwal [mailto:n...@jammconsulting.com] > Subject: RE: synchronizing in tomcat > > At first thought, I would create a class > with synchronized static methods to do each of your > processing tasks. That way, you are guaranteed > only one method is executi

RE: synchronizing in tomcat

2009-11-17 Thread Neil Aggarwal
> Does tomcat offer any mechanism for locking servlet executions? I think you are going to have to take care of this in your application code. At first thought, I would create a class with synchronized static methods to do each of your processing tasks. That way, you are guaranteed only one met

Re: synchronizing in tomcat

2009-11-17 Thread Leon Rosenberg
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 wrote: > Hi! > > Does tomcat offer any mechanism for locking servlet executions? > > So if one servlet does: >  - get 10 EUR from account 1 (read accoun

synchronizing in tomcat

2009-11-17 Thread David Balažic
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; stor