I am new to Hibernate this is my first post in the stackoverflow. I am using Hibernate 3.3.2 GA and MySql as a DB.
Here is my question:
I am reading the record for the DB table which is having status='N'.
List sendSmsPropertiesList=hbSession.createQuery("from TSendSms where status='N' ").setMaxResults(1).list();
I have 2 threads accessing the same table using above sql to fetch the record from the DB with status='N'(for example if there are 3 records with status='N', first thread should fetch first record and second thread should fetch the second record). But both are fetching same record(First record). Here i need to have a lock on the table row once it is fetched by one thread, when second thread comes then it should go to the second row.
Could you please help me with the above example?
Thanks in advance.