Dapper-Plus icon indicating copy to clipboard operation
Dapper-Plus copied to clipboard

Hints for sql server

Open ghost opened this issue 4 years ago • 4 comments

Hello there.

We have encountered the deadlock while using BulkInsert from DapperPlusActionSet. The deadlock is happened due to the concurrent update of the parent table and insert to a child table in few different transactions. The possible way to fix the issue is to use the SQL server hint for the insert query: OPTION (LOOP JOIN). However, I did not find any way to specify the hint while using dapperplus methods.

Is there a way to specify SQL server hints for insert statement located in the merge statement produced by the BulkInsert method?

Thanks.

ghost avatar Jun 14 '21 19:06 ghost

Hello @Rodale ,

There is currently no way to specify hint but I will talk with my developer tomorrow about this request.

Best Regards,

Jon

JonathanMagnan avatar Jun 14 '21 19:06 JonathanMagnan

Hello @Rodale ,

I speak with my developer and we are not sure exactly where you will put the option OPTION (LOOP JOIN).

Our library uses the MERGE statement and not an "INSERT SELECT + INNER

Is it possible for you to provide an example of syntax? We want to make sure that's possible and it will currently work with the way we already generate our SQL.

Best Regards,

Jon

JonathanMagnan avatar Jun 16 '21 01:06 JonathanMagnan

Hello @Rodale ,

Since our last conversation, I haven't heard from you!

As mentioned in my previous message, we are not sure exactly where you will put the option OPTION (LOOP JOIN).

Don't hesitate to provide an example of syntax so we can assist you better.

Looking forward to hearing from you,

Jon

JonathanMagnan avatar Jun 18 '21 12:06 JonathanMagnan

Hello @Rodale ,

A simple reminder that we are here to assist you!

Don't hesitate to provide an example of syntax so we can help you better.

Looking forward to hearing from you,

Jon

JonathanMagnan avatar Jun 25 '21 12:06 JonathanMagnan