LinqCommandExecutionException

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
john.valentine
Posts: 7
Joined: Tue 09 Mar 2010 20:15

LinqCommandExecutionException

Post by john.valentine » Wed 14 Apr 2010 15:34

Hey Devart,

We have been having a lot of trouble with the Devart dotConnect for Oracle. Both of the past 2 versions have been giving us issues with regard to our custom providers.

The Devart providers are not good enough for us as they depart from the standard .NET provider too much. It would be a lot of extra work to switch to SQL Server if our customer ever has the need. So we decided to use the Oracle Providers.

We created several new classes that inherit from the System.Web.Security classes from M$. Then using the repository pattern, we built classes to override the M$ classes and perform our own implementation using the Devart.Data.Linq.DataContext.

The problem with our solution is that the DataContext keeps throwing random errors. So today, I branched and upgraded my code to use the new 5.60 version. I am still getting random problems with IDataReader errors, and Db Connection errors where the connection appears to either be open or closed when it shouldn't. I am also getting some nebulous Stored Procedure failed errors.

All in all we are not real happy. We need someone to take control of this over at Devart and contact us as soon as possible so we can move forward.

Our Config:
- Oracle 10g
- Devart 5.60
- VS 2008 Pro .NET 3.5

The Stack Trace:

Code: Select all

Devart.Data.Linq.LinqCommandExecutionException was unhandled by user code
  Message="Error on executing DbCommand."
  Source="Devart.Data.Linq"
  StackTrace:
       at Devart.Data.Linq.LinqCommandExecutionException.a(String A_0, Exception A_1)
       at Devart.Data.Linq.Provider.DataProvider.a(b A_0, Object[] A_1, Object[] A_2, Object A_3)
       at Devart.Data.Linq.Provider.DataProvider.a(b A_0, Object[] A_1)
       at Devart.Data.Linq.Provider.DataProvider.h(Expression A_0)
       at Devart.Data.Linq.Table`1.System.Linq.IQueryProvider.Execute[TResult](Expression expression)
       at System.Linq.Queryable.FirstOrDefault[TSource](IQueryable`1 source, Expression`1 predicate)
       at MyProject.Model.Data.Oracle.Repositories.UserRepository.Exists(String userName) in C:\SourceControl\MyProject\trunk\Assemblies\MyProject.Model.Data\Oracle\Repositories\UserRepository.cs:line 111
       at MyProject.Security.RoleProvider.GetRolesForUser(String username) in C:\SourceControl\MyProject\trunk\Assemblies\MyProject.Security\RoleProvider.cs:line 143
       at System.Web.Security.RolePrincipal.IsInRole(String role)
       at System.Web.Configuration.AuthorizationRule.IsTheUserInAnyRole(StringCollection roles, IPrincipal principal)
       at System.Web.Configuration.AuthorizationRule.IsUserAllowed(IPrincipal user, String verb)
       at System.Web.Configuration.AuthorizationRuleCollection.IsUserAllowed(IPrincipal user, String verb)
       at System.Web.Security.UrlAuthorizationModule.OnEnter(Object source, EventArgs eventArgs)
       at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
  InnerException: System.InvalidOperationException
       Message=""
       Source="Devart.Data.Oracle"
       StackTrace:
            at Devart.Data.Oracle.OracleUtils.c(String A_0)
            at Devart.Data.Oracle.OracleDataReader.b()
            at Devart.Data.Oracle.OracleDataReader..ctor(aa A_0, aa[] A_1, OracleConnection A_2, CommandBehavior A_3, Int32 A_4, Int32 A_5, Int32 A_6, NumberMappingCollection A_7, Boolean A_8)
            at Devart.Data.Oracle.OracleDataReader..ctor(aa A_0, aa[] A_1, OracleConnection A_2, CommandBehavior A_3, Int32 A_4, Int32 A_5, NumberMappingCollection A_6, Boolean A_7)
            at Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
            at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
            at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior)
            at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
            at Devart.Data.Linq.Provider.DataProvider.a(b A_0, Object[] A_1, Object[] A_2, Object A_3)
       InnerException: 
The Code:

Code: Select all

        #region Private Member Variables

        NPDataContext context = null;

        #endregion

        #region Constructors

        public UserRepository()
        {
            context = new NPDataContext();
        }

        #endregion

Code: Select all

public bool Exists(string userName)
{
    var _user = context.OraAspnetUsers.FirstOrDefault(u => u.Username == userName);
    return _user != null ? true : false;
}
Kind Regards,

John

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 15 Apr 2010 15:47

Your code seems to be correct.
Could you please make and send us a test project illustrating the issue?
This will help us in our investigation.

john.valentine
Posts: 7
Joined: Tue 09 Mar 2010 20:15

Post by john.valentine » Fri 16 Apr 2010 13:56

AndreyR wrote:Your code seems to be correct.
Could you please make and send us a test project illustrating the issue?
This will help us in our investigation.
After seeing your message, I spent the rest of the day creating a sample solution for you. It is not pretty, but it does show the problem. Where do I send the code?

Thanks!

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Fri 16 Apr 2010 13:59

Send the project to support * devart * com, subject "LINQ: CommandExecutionException".

john.valentine
Posts: 7
Joined: Tue 09 Mar 2010 20:15

Post by john.valentine » Fri 16 Apr 2010 15:27

I sent the email a few minutes ago. Thanks!

Post Reply