I do not think this is a good idea. You should think of something
on the lines of supporting "version info" in your db to predict and
control race conditions like what you expect.

Add a version field to your table and send the version along with
the record to the browser. On update, increment the version before
updating. If someone else is updating a record with version earlier
than what you have in your table, reject the update.



> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of John Dixon
> Sent: Friday, June 09, 2000 12:30 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Database Record Locking
>
>
> What do I do if the user closes the browser? Thus leaving the record locked.
> Can I handle this with session unbound?
>
> JD
> >
>
> >
> > Or you could add a numeric field to the database and when the
> > user grabs the
> > info for updating set it to 1.  If anyone else tries to grab the
> > record and
> > the numeric field has a 1, deny access to that record.  After the user
> > updates the info set the field back to 0.
> >
> > cboyd
> >
> > -----Original Message-----
> > From: Ellis Miller [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 09, 2000 10:45 AM
> > To: [EMAIL PROTECTED]
> > Subject: Re: Database Record Locking
> >
> >
> > "select xxx...for update..." will allow for level of row locking
> >
> > -----Original Message-----
> > From: John Dixon [mailto:[EMAIL PROTECTED]]
> > Sent: Friday, June 09, 2000 7:46 AM
> > To: [EMAIL PROTECTED]
> > Subject: Database Record Locking
> >
> >
> > Hello,
> >
> > Just trying to figure this out:
> >
> > The App:
> > I have a JSP page that collects data from a database and displays it in
> > textfields. The user can change the data. click OK and the database is
> > updated.
> >
> > The question: How do I lock the record in the database so that another
> > user
> > cannot change the data whilst this user is in the midst of changing the
> > data. Using MSSQLServer.
> >
> > Many thanks!
> >
> > JD
> >
> > ========================================================================
> > ===
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
> > ==================================================================
> > =========
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
> >
> > ==================================================================
> > =========
> > To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> > JSP-INTEREST".
> > Some relevant FAQs on JSP/Servlets can be found at:
> >
> >  http://java.sun.com/products/jsp/faq.html
> >  http://www.esperanto.org.nz/jsp/jspfaq.html
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
> >  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets
>
> ===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.html
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
>  http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.html
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
 http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets

Reply via email to