Control the execution time out duration

Discussion forum about all things SqlBase or SqlTalk
mabdelkhalek

Control the execution time out duration

Post by mabdelkhalek » 31 Mar 2011, 09:40

We use Gupta 4.2
Connect to Sybase database

I tried to control the duration of timeout for procedure execution but it didn't work.

in sql.ini/section [sybgtwy]:
locktimeout=0 ! Make the execution time out 60 seconds (default value) for the whole application

I need to increase the time out for procedure execution takes big time, but I tried 2 seconds below just to check how the feature works.
The Code used in execution is:
Call SqlSetParameter ( hSql, DBP_LOCKWAITTIMEOUT, 2, '' ) ! Modify the time out to be 2 seconds
Call SybExecuteProc( hSql, "declare @nRC int
Exec @nRC = atm..psp_atm_copy_alt 0,Null ,:gnEmployeeID
select @nRC", ":CopyServices.nRC" )
Call SqlSetParameter ( hSql, DBP_LOCKWAITTIMEOUT, 60, '' ) ! Modify the time out to be 60 seconds as default

I expect raising time out message after 2 seconds but it didn't happened.
Kindly advise about how to control the execution time out.

FRBhote
India
Posts: 2208
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: Control the execution time out duration

Post by FRBhote » 31 Mar 2011, 13:35

SqlSetLockTimeout( hSqlDataBase, 2 ) ?

mabdelkhalek

Re: Control the execution time out duration

Post by mabdelkhalek » 05 Apr 2011, 08:47

Hi,
I tried the recommended command as below.
The execution takes 50 seconds but there is no time out message after 2 seconds:

Call SqlSetLockTimeout( hSql, 2 ) ! Modify the time out to be 2 seconds
Call SybExecuteProc( hSql, "declare @nRC int
Exec @nRC = atm..psp_atm_copy_alt 0,Null ,:gnEmployeeID
select @nRC", ":CopyServices.nRC" )
Call SqlSetLockTimeout( hSql, 60 ) ! Modify the time out to be 60 seconds as default

FRBhote
India
Posts: 2208
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: Control the execution time out duration

Post by FRBhote » 05 Apr 2011, 14:18

Does Call SqlSetLockTimeout( hSql, 2 ) return True?

mabdelkhalek

Re: Control the execution time out duration

Post by mabdelkhalek » 06 Apr 2011, 12:20

Hi,
I tried:
If SqlSetLockTimeout( hSql, 2)
instead of:
Call SqlSetLockTimeout( hSql, 2)
And it works fine.
Thanks for support.

Another point:
locktimeout configuration from sql.ini doesn't affect this lock time out (Why?)
If locktimeout from sql.ini = 0
What is the lock time out period?
What is the default lock time out and how to set?

FRBhote
India
Posts: 2208
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: Control the execution time out duration

Post by FRBhote » 06 Apr 2011, 13:15

The sql.ini is the default and SqlSetLockTimeout overrides this for the period that the program runs. Any other program (including sqltalk) will use the sql.ini value.

mabdelkhalek

Re: Control the execution time out duration

Post by mabdelkhalek » 07 Apr 2011, 16:54

Thanks for support and consider the issue is closed.

Return to “SqlBase General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests