This question is locked. New answers and comments are not allowed.
Ok, what's going on... perhaps I'm using OpenAccess incorrectly. Am I supposed to only have one domain model and put all tables in that one model.... that's currently not the way I'm doing it... I'm putting every logical entity into it's own model... I've already run into an issue with the connection name getting goofed up and/or confused that I resolved by giving every model it's very own connection in the web.config file... a bit annoying but ok... i can live with it i suppose....
Now I'm getting this other very odd error... what am I doing incorrectly? See error details below, and code snippet it came from.... By the way.. this code was working... but I've added some more code elsewhere since writing this code... and now it doesn't work... it's like OpenAccess is reusing stuff across the application that it doesn't need to be.... or needs to be reset upon each use??
***** Code snippet *******
public IList<Customer> GetCustomers(Guid userId)
{
IList<Customer> customers = null;
using (UserAdminContext dbContext = new UserAdminContext("UserAdminConnection"))
{
var query = from c in dbContext.Customers
from a in c.UserCustomerAssociations
where a.UserId == userId
select new Customer() { CustomerNumber = c.CustomerNumber, CompanyName = c.CompanyName, Identifier = c.Identifier };
customers = query.ToList<Customer>();
}
return customers;
}
****** Error ******
Error executing query: Telerik.OpenAccess.RT.sql.SQLException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The handle is invalid.)
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()
at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
SQL:
SELECT a.[CustomerNumber] AS COL1, a.[CompanyName] AS COL2, a.[Identifier] AS COL3 FROM [Customer] a JOIN [UserCustomerAssociation] AS b ON (a.[CustomerId] = b.[CustomerId]) WHERE b.[UserId] = ? Telerik.OpenAccess.RT.sql.SQLException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The handle is invalid.)
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()
at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
**** Inner Exception *****
A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The handle is invalid.)
Now I'm getting this other very odd error... what am I doing incorrectly? See error details below, and code snippet it came from.... By the way.. this code was working... but I've added some more code elsewhere since writing this code... and now it doesn't work... it's like OpenAccess is reusing stuff across the application that it doesn't need to be.... or needs to be reset upon each use??
***** Code snippet *******
public IList<Customer> GetCustomers(Guid userId)
{
IList<Customer> customers = null;
using (UserAdminContext dbContext = new UserAdminContext("UserAdminConnection"))
{
var query = from c in dbContext.Customers
from a in c.UserCustomerAssociations
where a.UserId == userId
select new Customer() { CustomerNumber = c.CustomerNumber, CompanyName = c.CompanyName, Identifier = c.Identifier };
customers = query.ToList<Customer>();
}
return customers;
}
****** Error ******
Error executing query: Telerik.OpenAccess.RT.sql.SQLException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The handle is invalid.)
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()
at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
SQL:
SELECT a.[CustomerNumber] AS COL1, a.[CompanyName] AS COL2, a.[Identifier] AS COL3 FROM [Customer] a JOIN [UserCustomerAssociation] AS b ON (a.[CustomerId] = b.[CustomerId]) WHERE b.[UserId] = ? Telerik.OpenAccess.RT.sql.SQLException: A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The handle is invalid.)
at Telerik.OpenAccess.RT.Adonet2Generic.Impl.PreparedStatementImp.executeQuery()
at OpenAccessRuntime.Relational.conn.PooledPreparedStatement.executeQuery()
at OpenAccessRuntime.Relational.fetch.FetchResultImp.Execute()
**** Inner Exception *****
A transport-level error has occurred when receiving results from the server. (provider: Shared Memory Provider, error: 0 - The handle is invalid.)