aspose file tools*
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Concurrent Submission to update the database" Watch "Concurrent Submission to update the database" New topic
Author

Concurrent Submission to update the database

Helen Choo
Greenhorn

Joined: Jun 20, 2001
Posts: 5
Hi,
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