"Thread was being stopped" while trying to connect to AS400 iSeries using .NET

  • Thread starter Thread starter Daniel Wilson
  • Start date Start date
D

Daniel Wilson

My codes blowing up with the "Thread was being stopped" exception when I try
to create a data connection. Here's the line of (MS VC++ .NET 2003) code
blowing out:
SourceConn = new
IBM::Data::DB2::iSeries::iDB2Connection(S"DataSource=ANTIGUA1;DefaultCollect
ion=EMBTEST;UserID=PCS;Password=PCS;");

The Exception Source is IBM.Data.DB2.iSeries.

Forum discussion shows this error turning up when a thread other than the
main application thread attempts to update a UI control while running in the
IDE.

I'm not running in the IDE, but on a test workstation, using a Release
compile. My application runs as a service, so there are no UI controls
involved.

Can anyone shed any light on this?

thanks.

Daniel Wilson
Senior Software Solutions Developer
Embtrak Team, DV Brown Company
864-292-5888
 
Here's a really simple set of code to duplicate the problem. This is a C++
..NET console app.

using namespace IBM::Data::DB2::iSeries;
int _tmain()
{
Console::WriteLine(S"Hello World");
try{
IBM::Data::DB2::iSeries::iDB2Connection *SourceConn = new
IBM::Data::DB2::iSeries::iDB2Connection(
S"DataSource=MyISeries;DefaultCollection=MyCollection;UserID=Me;Password=MyP
assword;");
}catch (System::Threading::ThreadStateException* Tex){
Console::WriteLine(S"ThreadStateException: {0}",Tex->Message);
}catch (Exception *Ex){
Console::WriteLine(S"Some other exception: {1} with message: {0}",
Ex->Message, Ex->GetType());
}
Console::WriteLine(S"Goodbye World");
return 0;
}

Output is:
Hello World
Some other exception: System.Threading.ThreadStopException with message:
Thread
was being stopped.
Goodbye World

Ideas, anyone?

Thanks.

dwilson
 
Resolution here: Reinstall Client Access on the PC in the right order.

Install Client Access V5R3 including the .Net Data Provider. Then apply the
service pack.

Adding the .Net Data Provider after the service pack makes a MESS.

hth somebody
dwilson
 
Back
Top