tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Øyvind Vestavik <Oyvind.Vesta...@idi.ntnu.no>
Subject RE: just one edit.
Date Tue, 21 May 2002 13:45:37 GMT

I don't know if you can set some property in web.xml or system.xml of
tomcat to only allow only one user to access a web-app or some other kind
of resource at a time. I shouldn't think
there were as this is contactory to what people want a webserver to do.

But you could modify your webapp or bean or whatever to not let more than
one user edit some data at the time using context variables.
When some administrator enters the restricted code part (eg the part that
modifies data) a context variable (for instance called busy) is set, and
when he leaves the code part, or logs out or whatever, this context
variable is deleted. When the second administrator tries to access the
restricted code, he will check to see if the busy-variable is set and if
it is is rejected. Else he can enter.

However. You should read about concurrency problems first. (For instance
in a good book about Operating Systems) as this kind of monitoring has
many problems attached to it, and making a fail safe system like this is
hard at the best..

Øyvind

Øyvind Vestavik
Øvre Møllenberggt 44b
7014 Trondheim
oyvindve@idi.ntnu.no
41422911

On Mon, 20 May 2002, Emilio Miranda wrote:

> yes,
> there is a jsp. I have a form. It is an web application (Servlets, JSP ,
> etc )to manage users but it could have two or more administrators so, my
> trouble is when two want to modify the data of one user at the same time-
> For example in other applications I saw message like "sorry this resource is
> used by other user" or something like that.
>
> Thanks a lot.
>
> -----Mensaje original-----
> De: Øyvind Vestavik [mailto:Oyvind.Vestavik@idi.ntnu.no]
> Enviado el: lunes, 20 de mayo de 2002 14:45
> Para: Tomcat Users List
> Asunto: RE: just one edit.
>
>
>
> Just to clear things up a bit:
>
> What kind of web resource are we talking about??
> Is java in the background??
>
> Øyvind
>
> Øyvind Vestavik
> Øvre Møllenberggt 44b
> 7014 Trondheim
> oyvindve@idi.ntnu.no
> 41422911
>
> On Mon, 20 May 2002, Emilio Miranda wrote:
>
> > Hi, really apreciate your help. but What I mean is a case in web.
> > It is:
> >
> > administrator A login to a site and modify data of some user
> >
> > at the same time administrator B are modifying the data of the same user.
> >
> > I would like some message for administrator A, something like a "sorry you
> > cant change these data right now" .
> >
> > So I want to know if Tomcat could help me in some way
> >
> > Thanks a lot!
> >
> > -----Mensaje original-----
> > De: Mike Jackson [mailto:mjackson@cdi-hq.com]
> > Enviado el: lunes, 20 de mayo de 2002 13:32
> > Para: Tomcat Users List
> > Asunto: RE: just one edit.
> >
> >
> > You'll probably want to synchronize on a static object I think.  Something
> > like this:
> >
> > 	public class WhatEver {
> > 		protected static Object lock = new Object();
> > 		public void doStuff() {
> > 			sychronized( lock ) {
> > 				// do protected stuff here
> > 			}
> > 		}
> > 	}
> >
> > --mikej
> > -=-----
> > mike jackson
> > mjackson@cdi-hq.com
> >
> > > -----Original Message-----
> > > From: Emilio Miranda [mailto:emiranda@atos-ods.com.pe]
> > > Sent: Monday, May 20, 2002 11:15 AM
> > > To: Tomcat Users List
> > > Subject: just one edit.
> > >
> > >
> > >
> > > Hello, I am sorry if that is an offtopic.
> > >
> > > How can I be sure that only one user is changing some data at the time?
> > > could Tomcat help me on that?
> > > I mean , supouse that one user change a name an another try to
> > > change at the
> > > same time.
> > >
> > > Thanks a lot!
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > > <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > > For additional commands, e-mail:
> > > <mailto:tomcat-user-help@jakarta.apache.org>
> > >
> >
> > --
> > To unsubscribe, e-mail:
> > <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> > <mailto:tomcat-user-help@jakarta.apache.org>
> >
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> > For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
> >
>
>
> --
> To unsubscribe, e-mail:
> <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:tomcat-user-help@jakarta.apache.org>
>
>
> --
> To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message