0

I'm getting an error when I'm trying to connect to sql server with entity framework and native SQL at the same time the error shown in windev side.

Erreur (blocage) de l'accès natif SQLSERVER. Numéro d'erreur = 117

In the .Net side I didn't get an error, could it be a problem of priority of access or something like that?

James Z
  • 12,209
  • 10
  • 24
  • 44
shams
  • 1
  • 1
  • Please read [Under what circumstances may I add “urgent” or other similar phrases to my question, in order to obtain faster answers?](//meta.stackoverflow.com/q/326569) - the summary is that this is not an ideal way to address volunteers, and is probably counterproductive to obtaining answers. Please refrain from adding this to your questions. – halfer Mar 30 '18 at 09:57
  • `Native SQL access` doesn't mean anything. Where does that error come from? Where is the code? Did you *google* for the error message (the English one of course)? Googling for `SQL Server error 117` returns issues that have to do with weird table names, that include dots, `@` and other unexpected characters *without* quoting. EF *does* quote table names, so where did that error come from? – Panagiotis Kanavos Mar 30 '18 at 13:32
  • If this is a .NET Exception, what is the *full* exception, including the call stack? You can get it easily with `Exception.ToString()` – Panagiotis Kanavos Mar 30 '18 at 13:33
  • PS: Googling for the french error message returns quite a few results too – Panagiotis Kanavos Mar 30 '18 at 13:34
  • i didn't get an exception on the .Net side . this is the error i'm getting in the windev side Voici le message en détail : "Erreur (blocage) de l'accès natif SQLSERVER. Numéro d'erreur = 117 SQL Server a renvoyé l'erreur 80040e31 Description: Délai de requête de verrou dépassé. SQL State: HYT00 SQL Error Number: 1222 – shams Apr 02 '18 at 08:28

2 Answers2

1

Windev seems to set up suboptimal lock strategies in SQL Server by default if you don't specify the right options yourself. (We encountered the very same errors at the company I work for).

I suggest you to use those two options. You do this at the launch of the application, when you set up the connection to the DB.

H.SQLServerMode = 0 to leverage the more performant driver SQLnCli (you have to install it before, it's provided by Microsoft).

HDescribeConnection(..., hNativeAccessSQLServer, "WD Command Timeout=0; WD Lock Timeout=0;" WD Lock Timeout=0; is the important option here. It tells Windev to let SQL Server configures its own lock policy, not trying to force SQL Server. If you profile the connection to SQL Server, you'll notice that Windev is now sending SET LOCK_TIMEOUT -1 to SQL Server.

Thanks to this, you shouldn't see any 117 lock request time out period exceeded anymore.

Cédric Paquot
  • 101
  • 1
  • 4
-1

What is your code on both sides? Why do you do that? If you make a connection on the same port on the same computer with two applications, it can indeed be a problem.

Bidjes
  • 166
  • 4
  • 10
  • This is not an answer. Remarks like this should be posted as a comment. – Peter B Mar 31 '18 at 21:57
  • i didn't get an exception on the .Net side . this is the error i'm getting in the windev side Voici le message en détail : "Erreur (blocage) de l'accès natif SQLSERVER. Numéro d'erreur = 117 SQL Server a renvoyé l'erreur 80040e31 Description: Délai de requête de verrou dépassé. SQL State: HYT00 SQL Error Number: 1222 – shams Apr 02 '18 at 08:25