CheckSynchronize called from thread which is NOT the main thread
SOLVED- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CheckSynchronize called from thread which is NOT the main thread
In my Javascript project, I am trying to connect to a SQL database. When it gets to the Open() function, it throws an error that says "CheckSynchronize called from thread which is NOT the main thread" -- I can't click OK to get out of it, the message just keeps coming back. I have to end task in task manager and come back in. Below is my code. Right before the CheckSynchronize error comes up, it brings up a login dialog and enters the user name that is in the connection string. It doesn't appear to get to the password.
var aCon, RecSet;
aCon = ADO.CreateADOConnection();
aCon.ConnectionString = "Data Source=remoteDesktopAddress, portNumber;Initial Catalog=NameOfDatabase;user id=SQLuserName;password=SQLPassword";
aCon.Open();
Solved! Go to Solution.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
That's rather strange. ADO connections shouldn't actually do any displayed login or anything. What kinda of SQL server are you connecting to?
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Microsoft SQL Server Developer (SQL 2016).
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
OK, what other code are you executing? Again, because ADO doesn't open any sort of UI, I'm assuming that the login screen you're seeing is coming from some other code. Let's set aside the ADO stuff for now because I think we're dealing with a different problem.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The code I showed is actually the first lines of code in the function that I am running, and it is the only function being run. My goal is to restore data to use for automation testing. Could it be something wrong with my connection string?
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Really? There is no UI interaction code at all in that. So, that tells me that something else is triggering some other code. Do you have an OnStartTest event handler created that's kicking off some UI code/login process? How are you kicking off that function (could you be accidentally running the project and not just the function)?
As mentioned... ADO has NO UI operations at all. It's all object code behind the scenes. So, we need to look elsewhere.
Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----
Why automate? I do automated testing because there's only so much a human being can do and remain healthy. Sleep is a requirement. So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.
Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is a fairly new project and I have not even brought the Events item into it yet. I am right-clicking in the function itself and just running the function.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @hrothrock,
Does TestComplete bring this error? Do you see the TC logo on the error dialog?
Is it possible that you run the function that has some parameters? For example, your code is inside a function like this:
function test(a, b) var aCon, RecSet; aCon = ADO.CreateADOConnection(); aCon.ConnectionString = "Data Source=remoteDesktopAddress, portNumber;Initial Catalog=NameOfDatabase;user id=SQLuserName;password=SQLPassword"; aCon.Open(); }
If you have the parameters in the function, you cannot run a routine via right-click.
Could you please check this?
Tanya Yatskovskaya
SmartBear Community and Education Manager
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tanya, I have no parameters in my function. I have tried this (accidentally) in the past and the option to run the function is disabled. I am not sure what program other than TestComplete would be returning the error but I guess it's possible?
Thanks.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @hrothrock,
Thanks for checking this. It sounds like this question requires a deeper investigation. Could you please zip your project and send it to the TestComplete Support Team? They will analyze the project and come back to you with the solution.
Tanya Yatskovskaya
SmartBear Community and Education Manager
