Ruaidhr�,
The person who responded below is correct. Particularly if you are using
Access as your db. You need to make sure that you close your connection to
the db AFTER you pull the information for your first page, and then REOPEN
the connection to the database to do an update. This will release the
record lock that you have on the open table, which is what is preventing you
from being able to write data back into your table. Leaving an open
connection to a database is a common novice programming error (no insult
meant by the way), and the MS literature (MSDN) does NOT clearly detail the
error messages that you will get under this scenario.
By the way, ALL database's have the ability to do a "record lock" to prevent
another user from updating data in a table that you are currently
"manipulating". One of the tricks of the trade in production type
environments is learning when to lock a set of records in a table(s)(i.e. to
prevent another user from obtaining those records until your done with
them), and when NOT to. Learn how to program with this concept in mind, as
you will run into this in a production environment.
Celeste
-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of Shawn Zhu
Sent: Monday, May 07, 2001 7:37 PM
To: [EMAIL PROTECTED]
Subject: Re: Database locked?
haha...it's only confusing when you describe it.
put it in simple words (I think what's you've been trying to describe):
1. your app is the only app
that's accessing the DB;
2. you are trying to do read/write to the DB
3. you get table is locked error.
Solution:
someone has suggested,
1. close your DB connection after trieving the records.
2. reopen your db connection to update a record
> -----Original Message-----
> From: Ruaidhr� Fernandes [mailto:[EMAIL PROTECTED]]
> Sent: Monday, May 07, 2001 5:04 PM
> To: [EMAIL PROTECTED]
> Subject: Re: Database locked?
>
>
> Hi again,
> It's a standalone application. Im writing a e-commerce
> web site for my final year project. I have tomcat
> running on my machine.It is the only application open.
> Do u know what i mean?
> Basically, one page pulls columns from a table and
> puts this information in forms so the user can edit
> the information on the web page. When the user hits
> the update button, the Update.jsp page is invoked and
> this pages tries updating the table with the values in
> the forms. But i keep getting that error message
> saying the data base is locked by the user who pulled
> the values from the table in the first page. Get me?
> Confusing stuff, i know.
> Let me know if you know anymore on this, and thanks
> for helping.
> Cheers
> Rui
>
> --- Shawn Zhu <[EMAIL PROTECTED]> wrote:
> > close your admin application that's using your
> > Access
> > database on machine 'RUI'.
> >
> > > -----Original Message-----
> > > From: Justin Owens [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, May 07, 2001 9:05 AM
> > > To: [EMAIL PROTECTED]
> > > Subject: Re: Database locked?
> > >
> > >
> > > You are running into a deadlock. You are try to
> > access
> > > records/tables that
> > > are locked by the database. There are a couple of
> > ways to
> > > remedy this. The
> > > first one is to close your first connection and
> > recordset. By closing
> > > these, it should free up resources. I am not sure
> > of the
> > > syntax or if you
> > > can do this in java/jsp as I have just started
> > learning (my
> > > experience comes
> > > from ASP programming), it sounds like a readonly
> > lock on the database.
> > > There should be richer lock types than this.
> > >
> > > Justin
> > >
> > > -----Original Message-----
> > > From: A mailing list about Java Server Pages
> > specification
> > > and reference
> > > [mailto:[EMAIL PROTECTED]]On Behalf Of
> > Ruaidhrm Fernandes
> > > Sent: Monday, May 07, 2001 10:33 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Database locked?
> > >
> > >
> > > Hi all,
> > > I'm getting an error saying :
> > > java.sql.SQLException: [Microsoft][ODBC Microsoft
> > > Access 97 Driver] Couldn't update; currently
> > locked by
> > > user 'admin' on machine 'RUI'.
> > >
> > > What my program does is,I have a JSP page that
> > opens a
> > > connection with the database and retrieves fields
> > from
> > > a products table in my database and stores them in
> > > forms. This allows users to edit/delete/add
> > entries to
> > > the database. When the user clicks the submit
> > button
> > > it should invoke the Updatetable.jsp page.
> > > The Updatetable.jsp page creates another
> > connection
> > > and either updates/deletes/adds entries to the
> > same
> > > products table depending on what the users choice
> > was.
> > > When I click the submit button, i get the error at
> > the
> > > top of this e-mail.
> > > Does anyone know why this is happening?
> > > Thanks Rui
> > >
> > > =====
> > > "If a rabbit's foot is so lucky,..... what
> > happened to the rabbit?"
> > >
> > > __________________________________________________
> > > Do You Yahoo!?
> > > Yahoo! Auctions - buy the things you want at great
> > prices
> > > http://auctions.yahoo.com/
> > >
> > >
> >
> ==============================================================
> > > =============
> > > To unsubscribe: mailto [EMAIL PROTECTED] with
> > body: "signoff
> > > JSP-INTEREST".
> > > For digest: mailto [EMAIL PROTECTED] with
> > body: "set JSP-INTEREST
> > > DIGEST".
> > > 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".
> > > For digest: mailto [EMAIL PROTECTED] with
> > body: "set
> > > JSP-INTEREST DIGEST".
> > > 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".
> > For digest: mailto [EMAIL PROTECTED] with body:
> > "set JSP-INTEREST DIGEST".
> > 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
>
>
> =====
> "If a rabbit's foot is so lucky,..... what happened to the rabbit?"
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
> ==============================================================
> =============
> To unsubscribe: mailto [EMAIL PROTECTED] with body:
> "signoff JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set
> JSP-INTEREST DIGEST".
> 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".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
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".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
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