U2 Toolkit for .NET - Entity Framework Sample "EntityFramework_CodeFirst2" not connecting

1.3k views Asked by At

I get this error when trying to modify the EntityFramework_CodeFirst and EntityFramework_CodeFirst2 projects:

Opening Connection [U2][UCINET-UO] [U2][UCINET-UO]WIN32 API Error:10053 An established connection was aborted by the software in your host machine[Rocket U2][UCINET - UNIRPC][ErrorCode=81009] The RPC failed Error in Socket Send and dataLength:36

Inner Exception:Unable to write data to the transport connection: An established connection was aborted by the software in your host machine. Inner Exception:WIN32 API Error:10053An established connection was aborted by the software in your host machine[Rocket U2][UCINET - UNIRPC][ErrorCode=81009] The RPC failed Error in Socket Send and dataLength:36

I have set my connection string to:

<add name="CustomerContext" connectionString="Database=dbPath;UserID=userId;Password=password;Server=serverIp;Pooling=false;ServerType=universe;ConnectTimeout=500;PersistSecurityInfo=true" providerName="U2.Data.Client" />

Using those same credentials I can successfully connect using the U2 DB Provider for .NET test connection program on both the ADO.NET and UniObjects connections. I just cannot get it to work for the EntityFramework_CodeFirst projects.

The UNIRPC is running on the host machine. Port 31438 is listening. Firewalls are off.

EDIT: I have set the environment variables UCINETTRACE and UCINETTRACESWITCH and have a trace log of the DataAdapter Sample. This is a snippet of the interesting part. Full trace here

5/30/2012 10:56:53 AM:ThreadID: ThreadID: 11 Thread Name : Cursor #1--UciStatement::OpenServerCursor() and SQL String::call *HS.OLEDBINFO('ACCTS', '', '', '', '', '1', '', 0, 1) 5/30/2012 10:56:53 AM:ThreadID: Exiting:ThreadID: 11 Thread Name : UciStatement::OpenServerCursor() 5/30/2012 10:56:53 AM:ThreadID: Entering:ThreadID: 11 Thread Name : UciStatement::AssociateServerCursor() 5/30/2012 10:56:53 AM:ThreadID: Exiting:ThreadID: 11 Thread Name : UciStatement::AssociateServerCursor() 5/30/2012 10:56:53 AM:ThreadID: Entering:ThreadID: 11 Thread Name : UciStatement::()ServerExecute 5/30/2012 10:56:53 AM:ThreadID: Entering:ThreadID: 11 Thread Name : UciStatement::ServerExecuteSql() 5/30/2012 10:56:53 AM:ThreadID: ThreadID: 11 Thread Name : [U2][UCINET][UNIVERSE]:ERROR: CAN'T EXECDIRECT SELECT FROM @TMP

EDIT 2: I have the HS.SALES example working and I am on UniVerse 11.4 (current). I spoke with Rocket Support and I did not know that I needed to authorize individual UV accounts with HS.ADMIN, which was likely the problem. I thought a solid connection to the database was going to cut it, especially since HS.SALES was working. I still need to "SQLize" my DICT files to allow them to work on ADO.NET (& EF) but I almost have it now.

2

There are 2 answers

10
Rajan Kumar On

Did you try DataAdapter Sample with same connection string? Is this working? Could you please provide TRACE LOG? You need to set the following :

Trace and Debug To debug your U2 Database Provider for .NET applications, you can use the U2 trace facility. To activate the trace facility, set the following environment variables:

SET UCINETTRACE=c:\temp

SET UCINETTRACESWITCH=4

0
Rajan Kumar On

Caould please try U2NETDK v1.2.0? I hope it will solve the above mentioned problem.

U2NETDK v1.2.0 BETA contains U2 Database Add-ins for Visual Studio 2010. Now you can use VS2010 Server Explorer to populate U2 Tables, Views and Subroutines.

It will allow you to create DataSet and Entity Data Model.