Q3 2012

October 17, 2012

What's new in Telerik OpenAccess ORM Q3 2012

FIXED
  • Add New Item Wizard: The generated Model Name should be equal to the written rlinq name. - When selecting ‚Telerik OpenAccess Domain Model’ from ‚Add New Item’ Visual Studio dialog and writing a rlinq file name, this name is not used for creating the OpenAccessContext. Now the RLINQ file name and the context name are synchronized.
  • Add OpenAccess Service wizard: Models with one way associations caused AOS wizard to fail the code generation step - Both Code Generation and missing metadata is now fixed for the cases when the model contains one-sided associations.
  • Association Editor: Many to Many associations are not mapped correctly when the two classes have different count of identity columns - When the two classes have different count of identity columns the Association Editor used to omit some of the column mappings and to display a validation message like "The join table association 'X_has_Y' has defined 1 association parts pointing to
    the source type 'X'. The 'X' has 2 identity members and either all or none of them should be included
    in the association definition."
  • Class name missing in a certain exception message in 1:1 associations - The class name is now shown in the 1:1 associations exception message.
  • Fluent API: The MapType() method failing to default-map members of type DateTime. - The behaviour when calling mappingConfiguration.MapType() is to default-map all primitive members inside the class for which the mapping configuration has been defined. This was not working for DateTimes and they were ommited when the default mapping occures. Currently all DateTime columns are properly handled by the default mapping.
  • Level Two Cache: Sending eviction message during SaveChanges could fail with exception when nothing needs to be send - When there is nothing to be evicted from the L2 cache logically, a NullReferenceException could be thrown.
    The workaround used to be to Insert/Update a dummy instance, avoiding 'empty' commits.
  • LINQ: Casted expressions (OfType) potentially not resolvable in further processing - In a LINQ expression of the form ctx.Where(x => x.Collection.OfType<Z>().Any(a => a.Prop == value)) the resolution of Prop could fail if Prop is declared on type Z, instead of the collection element type.
  • LINQ: Filtering on a nullable DateTime property generating wrong SQL in some cases - If the LINQ expression tree is constructed manually using the classes from the System.Linq.Expressions namespace and contains a node like "Expression.Constant(new DateTime?(someDateTime), typeof(DateTime?))", the DateTime value was not correctly appended to the generated SQL statement, which lead to an error for incorrect syntax.
  • LINQ: Filtering on enum properties not working for Dynamic Linq queries. - Dynamic Linq queries that contain filters based on enum values like:
    context.Customers.Where("CustomerType = \"Corporate\"")
    were not handled correctly and the generated SQL statement contained the string presentation of the enum constant value instead of the numeric presentation.
  • LINQ: Translation of Nullable.GetValueOrDefault() leading to incorrect SQL - When an LINQ expression like X.Where(y => y.NullableBool.GetValueOrDefault()) is translated, invalid SQL was produced.
    The workaround was: X.Where(y => y.NullableBool.GetValueOrDefault() == true) ; to explicitly test against a value.
    Now the generated SQL is valid.
  • Metadata Translation: Properties of type List not handled during runtime. - Properties of type List<Enum> were not handled during runtime. The problem was in the metadata translation layer as it should make sure that these fields are passed to the runtime as List<int> which is a correctly supported collection.
  • OpenAccessLinqDataSource: In Vertical Inheritance scenarios updating a row caused an error - Now the OpenAccessLinqDataSource is working successfully with Vertical Inheritance between classes.
  • OpenAccessLinqDataSource: Parent properties missing in Form View control when Vertical Inheritance is used - Currently the Form View dialog shows the parent properties when Vertical Inheritance is defined between classes.
  • Runtime: Assigning a managed shared field reference before adding the object to the context causing a cast exception - Adding a object to the context that has a shared reference with a managed inverse collection on the referenced side could cause a cast exception when the reference is set before the object is added to the context.
  • Runtime: AttachCopy could fail with deserialized, unmanaged instance graphs involving collections - When an object graph is deserialized (e.g. from JSON), the resulting object network could fail with an exception while attaching.
  • Runtime: AttachCopy could fail with NullReferenceException with mixed instance graph - When a detached Order object gets an unmanaged OrderLine added to it (inverse managed collection element), the AttachCopy operation used to fail with a NullReferenceException.
  • Runtime: Byte[] foreign keys not handled as shared fields. - If a foreign key is of type byte[], it was not recognized as shared field even if the metadata for that was provided. Having a byte[] as a foreign key is now possible as raw(16) columns from Oracle map to a byte[] by default and they logically represent Guids.
  • Runtime: Creation of database instance failing with OpenAccessException when done in parallel - When the database underlying an OpenAccessContext is obtained for the first time, some configuration values are set to the default values. This modification lacked a synchronization resulting in an OpenAccessException 'Unable to copy configuration value with null key'. As a result, an exception was thrown when there were concurrent attempts to open the database with the same backend configuration.
  • Runtime: Projecting link collection members from OQL potentially joins wrong tables - When a join collection is projected from an OQL expression, the needed join is created in a wrong fashion, resulting in an exception.
  • Runtime: Projection with parallel fetch failing with exception under specific circumstances - Performing a query with parallel fetching (default for OpenAccessContext) and having a DefaultFetchGroup attribute specified can lead to exception during the calculation of the parallel fetch when the original filter contains a subquery expression.
  • Runtime: Setting the value of a nullable integral field that is shared with a reference field, to 0 and then adding the object to the context results in a NullReferenceException - If a reference field and a nullable simple field are mapped to the same column and the simple field is set to 0 and the object is added to the context, a NullReferenceException is thrown.
    Source obj = new Source();
    obj.NullableTargetId = 0;
    context.Add(obj); //NullReferenceException.
  • Runtime: Synchronization of auto-incremented primary key inverse collections could fail with NullReferenceException - When an auto-incremented primary key instance is added to the context, and another instance uses the inverse collection of the inserted type, a synchronization can be attempted which could throw a NullReferenceException in case the collection is not managed and is not in memory.
  • Runtime: Synchronization of reference fields throws a MetadataException - When reference fields are synchronized with each other, but one of the references only uses a subset of the columns the other reference uses, then an MetadataException was thrown.
  • Runtime: Using Primary Keys with more than 3 columns could fail - When a primary key is defined with more than three columns, the in-memory handling of OIDs was partially broken.
  • Runtime: Wrong joins when IList:Contains(T) is used on a referenced instance - When a IList<T.Contains(T) method is used on a referenced instance in LINQ, the resulting join was not build up correctly.
  • Schema Generation: Indexes not always created for join table association - There are several join table scenarios when OpenAccess ORM does not generate migration script for creating indexes on the target end columns in the join table.
  • Second Level Cache: Eviction of query results missing, when joined type instances are modified. - When a LINQ query like ... from x in Xs join y in Ys ... is made, the query result does not have a dependency on the Y type. This could lead to incorrect/unevicted query results after an Y instance is changed.
  • Validation: Wrong validation error when using Auto Incremental GUIDs in MS SQL - The validation error was wrongly shown when there is a valid auto incremented GUID setup for MS SQL Server 2005+
CHANGED
  • Installation: CHM documentation removed from the default distribtion - The offline documentation is now available only as a separate download for the product, which reduces the size of the installation MSI and speeds up the installer.
  • General: The old Data Services Wizard is removed from OpenAccess - The deprecated Data Services Wizard is now officially removed from OpenAccess ORM. The new Add OpenAccess Service wizard should be used instead.

Enhancements

  • Add OpenAccess Service: Web API support - ASP.NET Web API service code generation added in Add OpenAccess Service wizard
  • Database Functions Support - Support for built-in and user-defined database functions is added in the Stored Procedure Editor. It is now called Domain Method Editor. The implementation includes Table-Valued functions support and LINQ-enabled scalar functions.
  • Client-side Incremental GUID support - OpenAccess now offers a client side GUID generator to produce optimal sequential values for all supported backends. The GUID generator is available as a key generator for persistent types in the Context API.
  • LINQ: Support for bitwise operators enhanced - Bitwise &, |, ^, ! operators are now supported in OpenAccess ORM LINQ statements.
  • LINQ: Support for DateTime methods - Support for the DateTime LINQ methods was added to the OpenAccess ORM LINQ engine: Date, Day, DayOfWeek, DayOfYear, Hour, Millisecond, Minute, Month, Second, Year, Now, UTCNow, AddDays, AddHours, AddMilliseconds, AddMinutes, AddMonths, AddSeconds, AddYears, Equals
  • Profiler: New alert for detecting client-side LINQ queries - Some LINQ queries can't be completely executed on the server-side, so OpenAccess executes parts of them on the client. A new alert is added to the OpenAccess Profiler for such cases, so the LINQ queries that are inefficient can be easily identified and improved.
  • Runtime: Support for shared fields on polymorphic references - Support for shared fields on polymorphic references has been added to the product. With this functionality you can share the foreign key values of your polymorphic references with other simple fields.
  • Fluent API: New method added for index creation in Many-to-Many scenarios - A new Method in the Advanced namespace is added - HasValueIndex - which specifies that an index should be created on all the non-primary key columns in the join table of a Many-to-Many association. It is used for fine-tuning the performance in certain scenarios.
  • Fluent API: Delete Orphans setting exposed - The Delete Orphans setting, supported by the OpenAccess Runtime, was not exposed in the new metadata. Now it is available in the Fluent Mapping API.
  • LINQ: Grouping over joined expressions - Now the LINQ implementation allows aggregates to be used over joined expressions like
    var q = from x in
    (from det in Scope.Extent<Northwind.OrderDetail>()
    join prod in Scope.Extent<Northwind.Product>() on det.ProductID equals prod.Id
    group new { det, prod } by det.ProductID into g
    select new { Make = g.Key, TotalOrders = g.Sum(z => z.det.Quantity * z.det.UnitPrice) })
    orderby x.TotalOrders descending
    select x;
  • LINQ: Translation of object.Equals(1) generating parameterized expression - When a geography value is compared (e.g. with .STIntersects(other)), a CLR type of SqlBoolean was returned or further processed in the database server. This forces the code to be writen like .STIntersects(other).Equals(1) in LINQ filters. However, the direct translation of the constant into a parameter as in .STIntersects(@p) = @p1 causes the MSSQL query optimizer to disregard an spatial index and to
    use a filtered index scan (because of the query compile-time unknown value of @p1).
    OpenAccess detects now the .Equals(0) and .Equals(1) method calls and produces a literal integer value instead of the parameterized value.
  • MSMQ: Better cleanup in case of failing initialization - When the initial setup of MSMQ fails, the cleanup was not fully done under certain circumstances. This could lead to later sharing violations.
  • Runtime: Order of SQL inserts to obey the order of logical adds into the context for same structured new objects - When a lot of new objects are stored, the order in which the objects appeared in the generated SQL was not predictable. Now the insertion order into the context is used to determine it. This applies only to identically structured (same fields have values) objects with the the same type.
  • Update Database From Model: Improvements in the change-set production and handling in the wizard. - The change-set that is shown by the wizard is improved. The limitations of the schema migration script are described in a documentation article that is available through a warning message in the wizard.
Have a feature request?

Post your feedback via the Data Access feedback portal or the public forums

What's new across all Telerik products?

See the updates feed

Next Steps

Download for free

Get your fully functional free copy of Data Access.

Get Data Access Sample Kit

Including demos and articles to get you started.

Suggest new features

Help us shape our roadmap.