tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Johan Kok" <j...@messianic.dyndns.org>
Subject RE: Design advice needed.
Date Mon, 03 Nov 2003 06:47:41 GMT
Anthony,

Did you consider reading the record without locks, and when an updated are
made, to take a write-lock, check that the original record are still the
same and then apply, otherwise fail.

Your intentions might not work unless all writes are passed through the
container, as Oracle will not have any control, until a write occurs, i.e.
you will have to open with read only, and only take out a lock when you are
going to write, as described above. for safety sake your container will have
to re-read the data in any case, before commiting, otherwise it may update
changed data, e.g. updates that are made through other processes or even
triggers.

If my memory serves me right, that is something you can do easily with
Oracle (i.e. there's a standard feature implemented), even with Oracle 6/7.




> -----Original Message-----
> From: Antony Paul [mailto:antonypaul24@hotmail.com]
> Sent: 03 November 2003 08:36
> To: Tomcat Users List
> Subject: Design advice needed.
>
>
> Hi all,
>     I need a replacement for row level locking in database.
> The requirement
> is if two users are updating the same row of a table only the user who
> updates first will be made to database second user must get a failed
> message. This can be done using row level locking. But it
> allows only one
> user to open page for editing at same time. If another user
> has locked the
> row then second user cannot lock the same row or update it.
> So I want to
> implement locking in Container. Is there any design patterns
> available for
> this. Or have anyone implemented this. I am using Tomcat
> 4.1,Servlets JSP
> and Oracle 8i. The application is using  MVC pattern but do
> not use Struts.
>
> Antony Paul
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-user-help@jakarta.apache.org
>
>


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


Mime
View raw message