'SQL Anywhere Error - 210: User 'another user' has the row in 'tablexyz' locked

I have multiple Java process which launches serially one by one. This process does job of loading data into tablexyz and then tablefinal. After first process finishes its job I get the following error:

SQL Anywhere Error - 210: User 'another user' has the row in 'tablexyz' locked.

It goes like this:

Process 1: Creates table tablexyz and loads data into it does some processing and then finally copies data into tablefinal. I commit transaction here after all steps.

Process 2: Drops/Empties table tablexyz if it is there and then again creates table tablexyz and loads data into it does some processing and then finally copies data into tablefinal. I commit transaction here after all steps.

My app fails at the process 2 and it gives tablexyz locked. I don't understand both process uses same database user myuser then why second process is not able to delete tablexyz created by first process. I am new to Sybase IQ.



Solution 1:[1]

the reason for this error is that maybe an user works with this "already existing" view/table.

Just look with sp_iqlock.

If it's locked a dba/admin/creator has to unlock it or drop the user which is locking the table.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Serkan Arslan