File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes Many connections to DB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Many connections to DB" Watch "Many connections to DB" New topic
Author

Many connections to DB

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

What do I need to do in order to insure that only one person is accessing the database at a time if multiple people will have the application that interacts with it. Or is this even something I should concern myself with.


GenRocket - Experts at Building Test Data
Barrett
Greenhorn

Joined: Jan 14, 2002
Posts: 2
It may, or may not be a concern. That depends on your application.
Here's a scenario to consider: 2 people read the same data from the database. Person #1 updates the data. Person #2 has no way to know that the data has been updated. Now person #2 submits their update. This wipes out person #1's changes.
If it's highly unlikely that a situation like this can occur it may not be worth worrying about. Depending on the type of application you are writing, it may or may not be an issue.
Stanley Tan
Ranch Hand

Joined: May 17, 2001
Posts: 243
Yeah, you probably want to watch out for the lost update scenario.
You also have to very careful as to which DBMS you are using. Different vendors implement locking and concurrency control different (especially Oracle) so you must be very aware of implementation to use the database efficiently.
 
wood burning stoves
 
subject: Many connections to DB