Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Concurrent Submission to update the database  RSS feed

Helen Choo
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!