Please be aware that the content in SAP SQL Anywhere Forum will be migrated to the SAP Community in June and this forum will be retired.

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.
In addition, once a call to an external function fails (due to missing folder path). And you create the missing path and make the call again, you get "Thread locked" error.

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
Thanks Jerry Yun

asked 22 Dec '11, 12:30

JerryY's gravatar image

accept rate: 0%

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?

(23 Dec '11, 11:19) Jeff Albion

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"

(18 Apr '12, 09:03) JerryY
Replies hidden

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.


(19 Apr '12, 11:28) Jeff Albion

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.

(18 Nov '12, 17:26) legezam

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.

(19 Nov '12, 11:27) Jeff Albion

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.

permanent link

answered 19 Nov '12, 08:31

JerryY's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 22 Dec '11, 12:30

question was seen: 2,433 times

last updated: 19 Nov '12, 11:27