on 2012 Sep 07 3:07 PM
I'm building an application and I have an EF4 EDM. I have imported a number of stored procedures as function imports into the model. Most of these functions do not return any return value.
I'm getting the following null reference exception when I call one of these function import methods:
System.NullReferenceException: Object reference not set to an instance of an object. at System.Data.EntityClient.EntityDataReader.Close() at System.Data.EntityClient.EntityDataReader.Dispose(Boolean disposing) at System.Data.Common.DbDataReader.Dispose() at System.Data.EntityClient.EntityCommand.ExecuteScalar[T_Result](Func`2 resultSelector) at System.Data.EntityClient.EntityCommand.ExecuteNonQuery() at System.Data.Objects.ObjectContext.ExecuteFunction(String functionName, ObjectParameter[] parameters) at LPRCore.CarSystem.CarSystemEntities.UpsertList(Nullable`1 listId, String listName, Nullable`1 listTypeId, Nullable`1 domainId, String salt, Nullable`1 lastUpdated, Nullable`1 whiteListAlarmClassId, Nullable`1 subscriber, Nullable`1 instanceId) in 😧\\ElsagTFS\\EOC4\\Client\\LPRCore Plugin CarSystem\\CarSystemModel.Designer.cs:line 2050 at LPRCore.CarSystem.HotListDataAccessor.SaveHotList(CarSystemEntities context, Nullable`1 subscriberId, Nullable`1 instanceId, HotList data) in 😧\\ElsagTFS\\EOC4\\Client\\LPRCore Plugin CarSystem\\HotListDataAccessor.cs:line 268
How do I correct this, or is it a problem in the provider?
Tony
Request clarification before answering.
I've found that the null reference exception does not occur if I modify the stored procedure so it returns a value by adding "SELECT 1;" to the end of the stored procedure. This is even though the Function Import's properties indicate that the return type is None.
We are actually in the process of evaluating SA and I have a contact inside Sybase. I've also reported this to him. He's been able to reproduce the issue and has sent it to the internal team responsible for this. So it is probably going to be fixed and released soon.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This issue has been tracked and fixed under CR 718762.
This fix will be in 12.0.1.3790, 11.0.1.2871, and future EBFs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
If you're on MacOS, build 3798 should contain that fix. Otherwise wait and see ... 😉
User | Count |
---|---|
76 | |
30 | |
10 | |
8 | |
8 | |
7 | |
7 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.