New Era - Setting Query Timeouts on SQL Server6.5
Posted in 1998
Hi, I am trying to set a querytimeout on SQL Server. I want to do this at application level and not on the server. I am using New Era 2.12 on Win95. Some background: When connecting to Informix the default lock mode is NO WAIT. So if I try to update a record that's locked I get back an error. However, default lock mode is WAIT in SQL Server. Therefore, any transaction trying to update a locked record has to wait for the locking transaction to commit or roll back before proceeding. Control does not return to the application until that happens. I cannot set LOCK MODE to NO WAIT on SQL Server and, as it implements page locking, I envisage many locking problems. So my plan was to try an update, or insert, whatever and if the command doesn't return in e.g. 4 seconds, try again etc, advise user record may be locked etc. However, I do not know how to do this in New Era and we are short on manuals, the help being of no use in this instance. Ideally I would like to do an ixSQLstmt.ExecDirect to SQL Server to set the querytimeout but this doesn't seem to be possible. Therefore I need an object and method where I can set this: If anyone has any ideas I would be extremely grateful. Thanks a lot, as always, John