wood burning stoves 2.0*
The moose likes JDBC and the fly likes Concurrent Submission to update the database Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Concurrent Submission to update the database" Watch "Concurrent Submission to update the database" New topic

Concurrent Submission to update the database

Helen Choo

Joined: Jun 20, 2001
Posts: 5
I am trying to update a database using servlets. Servlets must be allowed concurrent users to read and update the database. I have a few design choices in my mind but I am not sure which one is the best in performance and does not cause thread problems like deadlock and so on? Can someone give me a suggestion?
Database class- the class that control the connection to the database
Threads-used to read, delete and update the database
Servlets-response to the users.
When user enter into the selected servlets, the servlet will create threads to enter into the database class to read or update the information. Thread will create a new database class and updated the database.Thread is killed when the database is updated.
Should the connection to the database be static or non static if i want to ensure that every user who access the website get the most up-to-date information?
When does the database get updated(Committed), is it when the database connection is closed or when the statement is closed(the sql query)?
I agree. Here's the link: http://aspose.com/file-tools
subject: Concurrent Submission to update the database
Similar Threads
DSRA9110E Connection is closed
Where do I need synchronization in Servlets?
Are JSPs Thread Safe ?
URLyBird: DB with 'deferred write' capabilities
Creating JavaMail session pool