My Java application performs an SQL query including all rows from a table that's sometimes being modified at the time of the query executing.
Thus, I'm experiencing SQL Exceptions because the default behaviour in Dynamic Server is "LOCK MODE SET TO NOT WAIT".
I have set the lock mode for the table to "LOCK MODE ROW", to minimize the lockng scope.
What i need now is to set "SET LOCK MODE TO WAIT 5" on each Connection created against the database. Now my questions are fairly simple.
- Is it necessary to execute an SQL call for every single JDBC connection against the database?
- Is there a way to make all connections to that specifix database obey the "WAIT 5" rule?
Please note that I cannot set the "WAIT 5" on the entire dbms instance (even if it was possible) since there are other databases not needing this setting.
TIA!
Regards
Thor