Is there way how to release a lock in Informix from Java?
[Error Code: -107, SQL State: IX000] ISAM error: record is locked
In our test environment, we have a lot of lock exceptions and the only way how to solve it is restarting database.
PS: I am not looking solution for database expert. I want to solve this from Java or Groovy.
What happens is that another user has locked the record you want; this is normally transient and the use of SET LOCK MODE TO WAIT tends to be enough.
But this error can be avoid by using indexes, if they already exist then the data distributions are out-of-date and you need to UPDATE STATISTICS.
You really should talk to your DBA about this behavior.
To find the sessions that has locks over the table in question you can use the syslocks table:
To kill the session you have to be able to issue an onmode -z.
This is not a good practice, even if it is a test environment. The purpose of a test environment is to debug and this is not debuging. But neither bouncing the IDS is a good practice.