Hello,
I am developing java application that connect to
DB2 on AS400 server.
I am using
com.ibm.as400.access.AS400JDBCDriver JDBC driver.
I want to set the lock time out to 10 sec, means that id user A locks a record, user B that try to lock the same record will wait at most 10 sec until an exception will be thrown or the lock will be released.
I try the following things:
1)
java.util.Properties prop = new java.util.Properties();
prop.put("user", dbUser);
prop.put("password", dbPassword);
prop.put("currentLockTimeout" , 10); // I use also the propery name lockTimeout instead of currentLockTimeout
Connection connection = DriverManager.getConnection(this.getDbUrl(), prop);
2) execute
SET CURRENT LOCK TIMEOUT NOT WAIT
sql or
SET CURRENT LOCK TIMEOUT WAIT 10
3) concat the db url the string "{code};locktimeout=10{code}"
Nothing of my tries were successful.
Is ther any idea ???
thank,
Tomer