> Hi,
>
> I have a database which can be accessed lot of users at a
> particular point of time i need to allow one user only to update his value
> i suggest of synchrnozing the doPost() so that only one user can access my
> database and update his value any URL or workaround so that if i have
> multiple users in the que only 1 user update the database at a single
> point of time.
>
> And also I have a database which is residing in my server if a
> client access it and if that database crashes how shal i inform the client
> ab this one and also how should i protect my database for crash??
> Supposing A client updating the value in the mid of updating if that
> database crashes will those partial values shal be updated in the
> database.
>
Hi Srini,
don't synchronize the method, you will lock out any other thread that needs
to access it and this could
lead to deadlock problems if you are not careful (deadlock usually means a
dead server too).
You are much better off using transactions and db locking as it is the
database which is the focus of the
access rather than the servlet. Also, with database transactions you can
guard against incomplete updates.
Read a bit more on SQL, JDBC and how to acheive what you want.
Hope this helps
Andy Bailey
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html