I am using JDBC connection to get the resultset. I am using same JDBC connection to update some records of same table. This update is happening in different thread. It is working. My question is: Should I lock the connection when I do update or resultset.next() If not, will resultset.next() give me correct data or there can be potential problem
posted 14 years ago
Hi, You can use ResultSet.TYPE_SCROLL_SENSITIVE result sets to fetch data. But once it reads from the database, it can't see the changes made from other transactions. So you can call the refreshRow() to get the latest data from the database.