I am using a "select for update" with order by clause which is getting a deadlock. I was expecting that adding an order by should never lead to a deadlock, assuming the rows selected FOR UPDATE are locked in the order as
they are returned.

But is that true? Are the rows selected FOR UPDATE locked in the same
order as they are returned (as specified in ORDER BY)? If yes, why am I getting a deadlock?

P.S: transactions are getting committed by each session after 100 records (1 commit on each 100 records).

Regards
Sumit