How to handle multiple concurrent database requests/updates when using JDBC with servlets?
MAHESH MULCHANDANI All the dbms provide the facility of locks whenever the data is being modified. There can be two scenarios:
- Multiple database updates on different rows, if you are using servlets the servlets will open multiple connections for different users. In this case there is no need to do additional programming.
- If database updates are on the same row then the rows are locked automatically by the dbms, hence we have to send requests to the dbms repeatatively until the lock is released by dbms.
This issue is dealt with in the JDBC documentation; look up "Transactions" and "auto-commit". It can get pretty confusing.