NetTalk Central

Author Topic: SetSQLTimeout  (Read 4609 times)

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
SetSQLTimeout
« on: May 03, 2013, 07:18:19 AM »
I just saw this mentioned in another thread and i must have missed it when i came from nt4 to nt7 for a SQL app i have.

Could someone elaborate on this and its proper use?
I can see it appears to be used explicitly in the  _addfile method

is it still experiemental? Are there some specific scenarios where its use is expected, preferred?

TIA
poul

kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: SetSQLTimeout
« Reply #1 on: May 05, 2013, 05:04:58 PM »
Hi Poul,

I got Bruce to wrap any NT file access in these methods as I was having troubles with one of my apps.

I don't think you need to worry about it unless you are seeing SQL process's lock.

If you are, then you should try to wrap any source code file access in these methods.

Cheers,

Kevin

Poul

  • Full Member
  • ***
  • Posts: 160
    • View Profile
Re: SetSQLTimeout
« Reply #2 on: May 06, 2013, 08:52:27 AM »
thanks kevin
i certainly have seen occassional locking, but not necessarily because of Nettalk, as I have other applications in the same database.
is there an effect on your app, that it is able to detect or does the thread die silently?

... ok, i just ran a sql profile on a nettalk app, to try and understand.
i can see ThisNetworker._addfile, appears to wrap all insert statements in the RelationManager for an insert by default
in sql the effect appears to me as
SET Lock_timeout 10000
...declare the sql sp for the INsert statement
SET the Lock_timeout -1
execute the insert sp
....


set timeout is connection dependant, so it seems to me that the timeout is -1, meaning wait forever, when the Insert statement is executed.
is that is what is intended with this method?









kevin plummer

  • Hero Member
  • *****
  • Posts: 1195
    • View Profile
    • Production Accounting and Software Payroll
Re: SetSQLTimeout
« Reply #3 on: May 06, 2013, 03:38:14 PM »
Hi Poul,

If you google SQL Set Lock_timeout you will get a better explanation than I can write.

From my observations there is no negative impact on my apps - threads just don't lock anymore. Apps that were hanging 4-5 times a day run 24/7 now.

However, in your example below I would expect the Set lock_timeout -1 to run after the insert sp executes because the one clarion insert statement declares the SP and executes it and then in code the set lock_timeout -1 is called after that statement.

Cheers,

Kevin