none
how to make two applications read from one table

    Question

  • please i need to make two java applications read from one table, when the first application is reading a row the second application should go to the next row and when the second application is reading a row the first should go to the next row, so first app will not be able to read what the second app has read and vice versa, i'm thinking of using lock on the rows if it is lock how do i go about it, i will really appreciate it, because i have been seeking for the answer for so long.
    Saturday, September 07, 2013 4:47 PM

Answers

  • Hi,

    If you just need the two applications to read the data from one table(no update, insert, or delete operation), there is no need to add lock on that table or rows, because SQL Server placed Shared Lock while reading the data and released immediately after finish reading the row, multiple applications can read the data on the same row or on different row from the table at the same time.

    Thanks
    Candy Zhou

    Monday, September 09, 2013 7:58 AM

All replies