We have an C# enternal dll that gets loaded by dbextclr11.exe when the external function is referenced. If we have a single process that calls the external function, it works fine. But if we have multiple processes call the same function as the same time, it fails. It's like the dbextclr11 engine only supports single thread and it the call to the dll fails...any sub sequent calls fail also...only way around it is to kill the dbextclr11.exe process and reload it. We are using ASA 11.0.1.2506. |
I don't think it was ever resolved. We took the call to the dll out. I still belive the ASA call to external dll is single threaded. |
SQL Anywhere should support multiple calls out to an external environment.
Can you provide a sample of your class and code to show what you're executing, and the errors you're seeing exactly?
namespace CLRDLL { public class StaticTest { public static int WaitTime(int seconds) { //pause for above seconds. need to multiply by 1000 int i = 0; for (i = 1; i < seconds * 1000;) { i++; } return seconds * 1000; } } }
compile the code for ANYCPU, deploy to 2008 win64 server under the bin64 of ASA.
declare external function CREATE FUNCTION xp_ext_test( in @seconds int ) RETURNS INTEGER external name 'CLRDLL.dll::CLRDLL.StaticTest.WaitTime(int) int' language CLR
call the function from two differnt sessions of iSQL. Second call gets locked.
All threads are blocked SQLCODE=-307, ODBC 3 State="40001"
Hi Jerry,
I see that you've already opened a technical support case for this question - we'll respond to you via the technical support case and then update this thread once it's concluded.
Thanks,
Could You send me a link about this technical case or some information about how can we solve it, please? We are having exactly the same problem with ASA12.
We unfortunately were not able to reproduce the reported behaviour in-house from the code samples provided in the original case. If there is additional reproducible information, we would certainly like to see this.
Is there a simple test in code that you can provide to illustrate this issue?
Please also be sure to test on the latest available EBF for your version as there have been various fixes for external environments on many versions.