Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby motuzko » Mon 15 Jun 2015 14:17

Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types:

SCG.TAG.GES.RiskLimit.CalcEngine.CcObligorEngine+ObligorSpreadData
vs
SCG.TAG.GES.RiskLimit.CalcEngine.EmCcObligorEngine+ObligorSpreadData

The last working version was dcoracle84pro = Version 8.4.254 (25-Sep-2014)

Stack trace:

Object of type 'Devart.Data.Linq.Engine.ObjectReader`1[SCG.TAG.GES.RiskLimit.CalcEngine.CcObligorEngine+ObligorSpreadData]' cannot be converted to type 'System.Collections.Generic.IEnumerator`1[SCG.TAG.GES.RiskLimit.CalcEngine.EmCcObligorEngine+ObligorSpreadData]'.
* * at System.RuntimeType.TryChangeType(Object value, Binder binder, CultureInfo culture, Boolean needsSpecialCast)
at System.Reflection.MethodBase.CheckArguments(Object[] parameters, Binder binder, BindingFlags invokeAttr, CultureInfo culture, Signature sig)
at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at System.Reflection.ConstructorInfo.Invoke(Object[] parameters)
at Devart.Data.Linq.DataProvider.a(c1 A_0, IDbConnection A_1, IDataReader A_2)
at Devart.Data.Linq.DataProvider.a(c1 A_0, Object[] A_1)
at Devart.Data.Linq.Engine.DataQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
motuzko
 
Posts: 47
Joined: Tue 08 Sep 2009 18:02

Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby MariiaI » Tue 16 Jun 2015 10:32

Please provide us with the following information:
- the exact version of dotConnect for Oracle;
- the DDL scripts for the necessary database tables;
- the definitions of the DataContext, entity classes (e.g., send us the model with the *.Designer.cs file);
- the code snippet for reproducing the issue, etc.

If possible, please create and send us a small test project, with which this issue is reproducible. This will significantly speed up the process of determining the cause of the error and finding the solution for it.

Looking forward to your reply.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby motuzko » Tue 16 Jun 2015 20:12

Sent the project/script as requested.
In essence, the sample looks like

Code: Select all
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using DAL.Context;

namespace DotConnectBug001
{
  internal class Program
  {
    #region <<< Private methods >>>
    private static void Main()
    {
      //Works with 8.4.254.0
      using (var tmpTestContext = new TestContext())
      {
        List<Class1.InternalClass> tmpList1 =
          tmpTestContext.Test001s.Select(inTest => new Class1.InternalClass {Id = inTest.Id, Name = inTest.Name,}).ToList();
        List<Class2.InternalClass> tmpList2 =
          tmpTestContext.Test001s.Select(inTest => new Class2.InternalClass {Id = inTest.Id, Name = inTest.Name,}).ToList();

        Debug.Assert(tmpList1 != null);
        Debug.Assert(tmpList2 != null);
        Debug.Assert(tmpList1.Count == 2);
        Debug.Assert(tmpList2.Count == 2);
      }
    }
    #endregion
  }

  internal class Class1
  {
    #region <<< Nested type: InternalClass >>>
    internal class InternalClass
    {
      #region <<< Public properties >>>
      public Int32? Id { get; set; }
      public String Name { get; set; }
      #endregion
    }
    #endregion
  }

  internal class Class2
  {
    #region <<< Nested type: InternalClass >>>
    internal class InternalClass
    {
      #region <<< Public properties >>>
      public Int32? Id { get; set; }
      public String Name { get; set; }
      #endregion
    }
    #endregion
  }
}
motuzko
 
Posts: 47
Joined: Tue 08 Sep 2009 18:02

Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby MariiaI » Wed 17 Jun 2015 10:09

Thank you for the response. We have reproduced the issue. We will investigate the issue more clearly and inform you about the results as soon as possible.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby motuzko » Tue 30 Jun 2015 13:25

Do you have an estimation?
motuzko
 
Posts: 47
Joined: Tue 08 Sep 2009 18:02

Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby MariiaI » Wed 01 Jul 2015 05:12

We have fixed this issue. The fix will be included in the next public build of dotConnect for Oracle, which we plan to release in several days. We will post here when it is available for download.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby MariiaI » Fri 03 Jul 2015 06:18

New build of dotConnect for Oracle 8.4.447 is available for download!
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://forums.devart.com/viewtopic.php?f=1&t=32065.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby motuzko » Fri 31 Jul 2015 15:23

This issue has been fixed; although there is(are) more to address before I can use the latest version.

Would it be possible to obtain a version of installation based on Version 8.4.254 (25-Sep-2014) which can be used in VS 2015? Meanwhile I'll try to create a test project that replicates the issue (which unfortunately may take several WEEKS).

Or maybe there is a way to make the dcoracle84pro = Version 8.4.254 (25-Sep-2014) package to be compatible with the VS 2015 so I will not get the

Assembly (xyz) is not licensed to use dotConnect for Oracle.

Thanks!
motuzko
 
Posts: 47
Joined: Tue 08 Sep 2009 18:02

Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby MariiaI » Mon 03 Aug 2015 09:08

Would it be possible to obtain a version of installation based on Version 8.4.254 (25-Sep-2014) which can be used in VS 2015?
We don't make patches. New functionality and bug fixes are included into new builds of dotConnect for Oracle.
If you have a valid subscription for dotConnect for Oracle, you can download the latest version of dotConnect for Oracle from Registered Users' Area.
The subscription is valid during one year since the purchase of dotConnect for Oracle or renewing the subscription.
If your subscription is not valid, you have to renew your subscription and download the latest version of dotConnect for Oracle.

Meanwhile I'll try to create a test project that replicates the issue (which unfortunately may take several WEEKS).
We are looking forward to your reply with a sample project for reproducing the issues.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17

Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby motuzko » Wed 12 Aug 2015 14:10

OK, sorry for the delay, but I finally managed to create another project for broken functionality.
Again, the code works with 8.4.254.0, but does not with all the consequent versions.
Looking for your response.
Thanks!
motuzko
 
Posts: 47
Joined: Tue 08 Sep 2009 18:02

Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby MariiaI » Thu 13 Aug 2015 08:20

but I finally managed to create another project for broken functionality.

Unfortunately, we didn't receive response from you. Probably, your letter was blocked for some reason (i.e. the attachment, etc.).
Please re-send your letter again. Also, please send it to 'mariiai at devart dot com'.
As an alternative, you can upload your project to some file exchange server and give us a download link.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17


Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby MariiaI » Fri 14 Aug 2015 10:40

We still didn't receive anything from you.
Please specify whether you have sent us the letter via our contact form ( http://www.devart.com/company/contact.html) or directly to support at devart dot com. Please also specify the e-mail address from which the letter was sent.
MariiaI
Devart Team
 
Posts: 1472
Joined: Mon 13 Feb 2012 08:17


Re: Looks like the LinqConnect library gets confused when materializing objects with the same name nested in different types

Postby motuzko » Fri 14 Aug 2015 12:29

As for the e-mail, here's what I got yesterday

Image
motuzko
 
Posts: 47
Joined: Tue 08 Sep 2009 18:02

Next

Return to dotConnect for Oracle