Q2 2012 SP1

June 28, 2012

What's new in Telerik OpenAccess ORM Q2 2012 SP1

  • Add OpenAccess Service: Various fixes and improvements in the wizard and generated code - Fixed issues with WCF Data Services generation in Visual Studio 2012 RC. Create/Update/Delete operations are now not available for views. The Telerik.OpenAccess.DataServices.50.dll binary is now updated by the Upgrade references command.
  • Association Editor: Added missing validation to the editor - Validating property names now takes into account existing properties. Added validation for one-to-one scenarios with two database calculated identities. Added validation for one-to-one self-referencing associations. Improved property/column grids, it is now impossible to use a property/column twice.
  • Fluent: Calling HasConstraint() does not create a constraint for unidirectional associations. - If a user uses the parameterless HasConstraint() method do declare that he wants a constraint created for an association ( config.HasAssociation(x=>x.Person).HasConstraint() ), the constraint was created only if the association was bidirectional e.g. there was a WithOpposite() call before the HasConstraint() one.
  • Fluent: Inconsistent source and target ends of many-to-many associations - The source and target ends of a m:n association used to depend on the order of the configurations that were defined.
  • Level Two Cache: Ability to specify multiple queue names that configure fallback queues - In environments where the second level cache of Telerik OpenAccess ORM is used within IIS it is useful to be able to specify more than one queue for fallback scenarios. Overlapped recycling will be possible then. The queue names are separated with a semi-colon. The initialMessageTimeout can now be adjusted as well.
  • LINQ: Using intermediate locals to hold query fragments for composition might not work - Using a local variable to hold a queryable fragment of the whole query expression could have led to 'Query parameter name is not declared' exceptions.
    int num = 10000;
    var q = Scope.Extent<Northwind.Order>().Where(o => o.Id > num);
    var q2 = Scope.Extent<Northwind.Customer>().Where(c => q.Any(o => o.CustomerID == c.Id));
    var r = q2.ToList();
    Workaround: Avoid the local, use the query expression directly in the LINQ expression.
    var q2 = Scope.Extent<Northwind.Customer>().Where(c => Scope.Extent<Northwind.Order>().Where(o => o.Id > num).Any(o => o.CustomerID == c.Id));
    var r = q2.ToList();
  • Medium Trust: Materializing to a Non-PC type from a Data Reader yields SecurityExceptions - When a DataReader is used to materialize to a type which is not a persistence capable (like DTO for example), SecurityExceptions could have been thrown under medium trust.
  • Runtime: Ado type mapping requires length - If an ADO or CLR type mapping is added to the container.DefaultMapping.ClrMap or container.DefaultMapping.AdoMap, it used to be necessary to specify the length and scale. This no longer applies for types that does not support this setting.
  • Runtime: Artificial types do not respect the default fetch group - Artificial types that contain non value type fields like references and collection used to return those as null values even if they marked as eagerly loaded.
  • Runtime: Data in join tables was not deleted when additional autoset fields were mapped in many to many setups - When working with many to many setups and having additional autoset fields mapped in the class, it could have been, that data stored in a join table was not deleted, causing foreign key violations.
  • Runtime: Duplicated optimistic locking fields - If the mapping of an optimistic locking field is specified in the app.config and in the persistent attribute, only the setting from the app.config file were taken in account. This lead to duplicated columns that are not synchronized.
  • Runtime: Exists statements should only be generated if possible - OpenAccess generates as many exist fragments as possible. If a projection value is calculated inside an exists fragment, the SQL is not executable. In such cases, the exists is now replaced by a distinct join.
  • Runtime: Handling of navigation to 1:1 partially missing, leading to insufficient checks with NULL values - When a 1:1 relationship is used in a LINQ query like ' ... where person.Address == null', only foreign key relationships used to be handled correctly; 1:1 requires a left outer join to test against a NULL value.
  • Runtime: In multithreaded scenarios an InvalidOperationException is randomly thrown while trying to save similar objects with a 'varchar(max)' column in parallel. - The runtime used to randomly throw an "InvalidOperationException - Nullable object must have a value, while trying to save objects with a character column (varchar(max),nvarchar(max),ntext)" under certain multithreaded scenarios.
  • Runtime: Inserting multiple instances of a derived vertically mapped class can fail. - Inserting multiple instances of a derived class with 'Vertical' inheritance strategy and 'Database server calculated' identity mechanism used to throw an exception with the message - ' Previous result set was not closed.
  • Runtime: Insufficient handling of database connection and transaction when non-fatal error occurred during Flush() or Commit(). - When a non-fatal error like OptimisticVerificationException occurred during Commit/Flush, the underlying database connection and transaction was not handled correctly.
  • Runtime: Parallel fetch of collection in derived class - If a collection in a derived class is included as parallel result into a base class query, the result set might have not been complete.
  • Runtime: Persistent class with Identity Mechanism Guid will override manually set identity - A persistent class that has a Guid Identity Mechanism used to override the explicitly specified identity when it is a part of a one-to-one association when saving changes to the database.
  • Runtime: Potential difference between enhanced default fetch group and SQL default fetch group - When the enhanced default fetch group contains more fields than the SQL default fetch group, inefficient or wrong operations were possible because in-memory state can be different than executed operations.
    This can occur when there is a difference between enhancement information and runtime information or when a non-default value type is used (SqlHierarchy).
  • Runtime: Schema handler has wrong mapping after metadata replace - If the metadata has been changed on a context instance, the schema handler was still using the old metadata.
  • Runtime: Schema Migration could have generated double drop index statement - If a class has several new indexes defined, an unnecessary drop index statement is generated. Workaround: add only one index per schema migration run or correct the migration script prior to execution.
  • Runtime: Should not initialize key generators to early - The full initialization of the metadata can only be performed after the schema migration has been completed. For replace metadata this means, the initialization has to be done after the schema migration call back returns.
  • Runtime: Using a column as a discriminator and as a property causes wrong insert statement generation - If a column is used as an inheritance modifier and for a property, Telerik OpenAccess ORM generates wrong insert statements adding the column twice to the statement.
  • Schema Read: SQL server replication setup databases contains artifacts - If replication is enabled on a SQL server database, a lot of extra tables, views and stored procedures are added. Those artifacts were not filtered out by the OpenAccess schema read and could have led to command timeout exceptions.
  • SDK: Silverlight 5 Tools for Visual Studio requirement check was wrong. - The requirement check for Silverlight 5 Tools did not work as expected with certain versions of the toolkit.
  • SDK: SofiaCarRental21 database creation script is not compatible with SQL Server 2012 - The script that is used to create the SofiaCarRental21 database used to be incompatible with SQL Server 2012.
  • SQLite : Invalid 'CREATE TABLE' SQL is generated when a class with 'DatabaseServerCalculated' identity mechanism has an integral identity field other than Int32 - When a class has 'DatabaseServerCalculated' identity mechanism the corresponding primary key column in the table has the 'AUTOINCREMENT' keyword specified. If the identity field in the model is of type Int64 this generates a column with SQL type - 'bigint' along with the 'AUTOINCREMENT' setting. 'AUTOINCREMENT' is allowed only on a INTEGER data type column and hence an exception was thrown while trying to create the table
  • Stored Procedure Editor: Fixed issue related to handling of string parameters - When NULL is passed as a value of a stored procedure String parameter, the value was not handled correctly and an exception was thrown: "Procedure or function [] expects parameter [], which was not supplied"
  • Update From Database: Mismatch in the FK columns for associations with composite primary keys. - If you have an association (1:1) that has a composite primary key on both sides when updating from database your association source and target columns used to be mixed.


  • Runtime: Attaching new objects - OpenAccess can now attach new objects. These objects can be the result of a deserialization, which makes the detach/attach functionality applicable in N-Tier scenarios.
  • Runtime: Improve support for 1:1 associations - One is no longer forced to specify IsRequired() on one of the association ends of an one-to-one association. Unidirectional 1:1 associations with Fluent API are now supported. Enhancements to the Fluent API were developed in order to support such scenarios. The validation rules executed in the Association Editor are also improved so that they check for more 1:1 specific issues.
  • Fluent: Introduced support for mapping struct properties and fields - Custom structs can now be a part of a model that is mapped using the Fluent API. Supported scenarios include basic struct mapping as well as a struct nested in structs.
  • Fluent: Introduced support for polymorphic references - Polymorphic references (references of interface types) can now be used as a part of a model mapped using the Fluent API. Specifying the allowed types can be done using one (or more) calls to WithAllowedType(Type). Example:  configuration.HasAssociation(x => x.Animal).WithAllowed(typeof(Cat)).WithAllowed(typeof(Dog));
  • Runtime: Ignore existing indexes during schema migration - It is now possible to ignore existing indexes on the database (delete scripts will not be generated for them) during the schema migration. A new property called CheckExtraIndexes is added to the SchemaUpdateProperties.
  • Runtime: Prevent refresh after SaveChanges - The default setting for a context is to refresh all loaded objects after SaveChanges has been called and the objects are touched again. A new setting has been added that can avoid this time consuming operation but will increase the risk for concurrency control conflicts.
    The new setting can be used like: context.ContextOptions.RefreshObjectsAfterSaveChanges = false, this setting will be taken into account after the next SaveChanges or RollbackChanges call.
  • Runtime: Schedule GC run if last context using replaced metadata is disposed - If metadata replace has been called on a context instance, the old metadata is still used by old context instances. To help the Garbage Collector, OpenAccess calls GC.Collect(0) if the last context with an old metadata version has been disposed.
  • Visual Studio 2012 RC: Introducing new metro style icons for the Visual Designer - A set of new icons has been introduced in the OpenAccess design time support for Visual Studio 2012, that complies with the metro requirements.
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.