Data Access 2009.2701

June 30, 2009

New Features and Enhancements

  • Views support in reverse engineering wizard - Views are now detected during reverse engineering. An additional tree node contains all database views. By default the views are not mapped to classes. It is possible to map them all or to map them one by one. The generated classes are similar to the classes mapped to tables.
  • SQL Server 2000 support - SQL Server 2000 is still used by many customers. The OpenAccess ADO driver is not working because of the MARS restrictions. OpenAccess has to get the NTDS driver again.
  • Oracle: Better optional mapping for GUID fields as raw(16) - It is possible now to map a Guid field to a raw(16) column, and the reverse engineering is detecting such a column correctly. In order to map to such a column, the following elements must be added to the mapping file under the respective field element:
    <extension key=""db-type"" value=""GUID"" />
    <extension key=""db-sql-type"" value=""RAW"" />
    <extension key=""db-length"" value=""16"" />
    The mapping can be set by using the forward mapping wizard.
  • HighLow Key Generator Startup Improvement - The HighLow key generator uses an auxiliary table holding the highest primary key id given out to a client for a given table. During startup of an application, all classes using such a key generator initialize it, thereby causing many SQL server calls. This has been reduced to one query in the normal case (table row is found in the auxiliary table). This helps greatly when starting an application (esp. over a VPN), reducing the load on the SQL server as well as reducing the network traffic.
  • MySql should use the latest mysql client implementation - So far MySql was always accessed with an old .NET ADO 1 driver. This was build by Telerik and included in the delivery. Now it has been replaced by the newest MySql driver 6.0.3. This is also included in the delivery and installed in the GAC but is the official MySql version.
  • Oracle LINQ support improvements - At the moment, some SQL statements generated by LINQ produce invalid SQL for Oracle (valid for MSSQL).
  • Implement support for executing Contains method on an outer IEnumerable collection. - "Implement support for executing Contains method on an outer IEnumerable collection that is not persistence capable. At this time this works only for a List (and may be some other specific collection types). For example:
    from o in scope.Extent<Order>()
    where <IEnumerable_instance>.Contains(o.OrderID)
    select o;

    *Workaround*
    var filterList = IEnumerable_Instance.ToList(); from o in scope.Extent<Order>()
    where filterList.Contains(o.OrderID)
    select o;"
  • WinForms LINQ 101 Examples app - WinForms LINQ 101 Examples app is now part of the product and can be started from the start menu.
  • Generic data access - A new API to access the persistent data in a generic way has been added. The entry point is objectScope.PerssistentMetaData. The API follow the .NET PropertyDescriptor way but does not use any reflection and is very fast.
  • Class Ids cannot be changed - The descriminator column value can be changed in the mapping. The class id that is used to generate ObjectId instances can not be changed and is derived from the fullname of the class. If a class is now moved to a different namespace the class id value will change and the oid strings that are stored somewhere are not longer valid.
  • Persistent Classes should be sorted in all wizard comboboxes - In some wizard we can select a member from a Persistent Class Combobox. Those entries should be sorted alphabetically.
  • Improve the Design-Time support of OpenAccessDataSource - Disable selection of properties that do not have the "FieldAlias" attribute for filter statements. Change the messages when the project is not set-up correctly in the first page of the datasource wizard.
  • Add support for Linq InvocationExpressions. - Support for Linq InvocationExpressions so that dynamic predicate can be built before executing any linq statement. The predicate can be passed as parameter to the Where() clause and the query will be executed against all the conditions set in the predicate.
  • Provide UI (combobox) to specify the SQL type for a column in a join table - SQL type for a column of a field can be specified in the forward mapping wizard. It should be possible to specify similar mapping for the column of a join table.
  • Improve VB support for LINQ - Corrected handling of Convert expressions. A base member access generates a different Linq node than C#
  • Allow 'xxx-xxx-xxx-xxx' strings interpreted as Guids by OQL - As a user I want to filter on a Guid column in the RADGrid so the filter value must be settable via DataSource generated queries.
  • Avoid thread local storage usage for LogEvent - This avoids VS2008 WebServer crashes and improves performance as well. It only happens under medium trust.
  • Make opening of a database more efficient when key generators != highlow are used. - The startup of an application using autoinc, guid, verify or roundtrip key generators has been improved.
  • Make database metadata compilation culture insensitive so that the current culture does not affect database opening. - As a foreign user I want to open the database even without switching to the en-US locale temporary. If the metadata file is read with a turkish culture OpenAccess cannot detect some of the keys because all 'i' characters are mapped to a special turkish 'i'.
  • Using Windows FIPS validated cyptographic algorithms with OpenAccess - It is possible now to use OpenAccess in a FIPS secured environment when .Net Framework 3.5 is installed and only the runtime is used (currently enhancement is not possible).
  • Provide a default stored procedure mapping for tables that use Stored Procedures in the Reverse Mapping wizard - When Stored Procedures are used for operations on a table, in the Reverse Mapping wizard, the user can map an existing Stored procedure to an operation on a table. Based on the current table settings OA calculates the required stored procedure. If existing Stored Procedures satisfy the requirements, OA should map the best fitting SP, by default. Further, if any mappings for the table are changed (adding PK fields, unmapping columns etc) the required SP should be recalculated.

Fixes

  • 'Add data form' generates master detail grid form that is not working - The ObjectView has a new setting ReferencesAsCollections. In a Master-Details scenario with Microsoft Grids this has to be set to true.
  • Inability to specify mapping for specific database server versions - "When using MSSQL 2000 and 2005 with the same data model, a specific mapping for string->NVARCHAR(MAX) is not possible because NVARCHAR(MAX) is only valid for 2005. When such a column mapping is required for a specific version of a database backend, you can now use <extension key=""db-column"" value=""mssql2000""/> in the mapping to denote a specific version. The names of the specific backends are 'mssql2000', 'mssql2005', 'mssql2008', 'firebird2.1', 'oracle10', 'oracle11', 'sqlanywhere11', 'mysql5'. The specfic names are matched with String.StartsWith, which makes it possible to use 'mssql' for all MS SQL Database server versions, but 'mssql2005' will only match if a SQL2005 server is actually used.
  • Static method generation,in VB, for invoking a reverse engineered Stored Procedure is not compilable - The Reverse mapping wizard reads information about existing stored procedures. A static method can be generated that can be used to invoke this stored procedure. The generated code for VB is uncompilable
  • Clicking on Transient check box in the forward mapping wizard results in NullReference exception - This happens only for fields of types that have no mapping information so far.
  • GetClassId does not return the correct class id - "If the class id has been changed in the mapping the method Database.GetClassId(object) returns the default value for the class id and not the one from the mapping. The runtime nevertheless works fine. The class id can be of type int or string. The Api can only return int! If the class id is set to a string value the method should throw an exception. The real classid is only set if it is necessary, if there are is no class hierarchy or persistent interface the real class id will not be set. In this case the method should return 0. Otherwise the really used class id should be returned. The class id can now be set in both layer. class-id is used in the api and as default for the database, db-class-id is use in the database. Both values can be access from the API via the new property descriptor api: scope.PersistentMetaData.GetPersistentTypeDescriptor(typeof(MyType)).ClassId scope.PersistentMetaData.GetPersistentTypeDescriptor(typeof(MyType)).DescriminatorValue
  • If Database.Get throws an exception the same connection id is not longer usable - If the given connection id is not pointing to a existing connection id an exception is thrown. After that you cannot ruse the connection id even with the right configuration because the failing database instance seems to be cached.
  • SqlAnywhere: Schema retrieval and update process does not detected unique indexes correctly - When an unique index is detected as non-unique, the schema update will try to recreate the index as unqiue; this causes constant index recreation during every schema update.
  • Forward mapping dialog is slow - Sometime if there are huge projects in a solution the forward mapping wizard is really slow. To make it faster all not enabled projects are now ignored.
  • Default table name generator can fail under Turkish culture when class name contains capital I - There was a discrepancy between the culture settings during database migration and runtime opening of the database; the invariant culture is used now in all circumstances.
  • LINQ/OQL: Parameters must be used as the right most argument in the query tree - "In a LINQ query expression, the following was invalid and produced a runtime error:
    from x in scope.Extent<Agt;
    where x.y <= param * 2
    but the following worked:
    from x in scope.Extent<A>
    where x.y <= 2 * param
    It has now been fixed so that both ways work."
  • LINQ: InvalidOperationException (Must specify parameter on right side of operation.) when nullable value type parameter is used. - When a nullable value type parameter (int? etc.) is used in a LINQ query, the runtime falsely throws an InvalidOperationException.
  • LINQ: VB support for group aggregates missing - When using a LINQ expression like
    Dim categories = scope.Extent(Of Product)().GroupBy( _ Function(p) p.Category.CategoryName). Select(Function(g) New With { _
    g.Key, _
    g.Count(), _
    .Sum = g.Sum(Function(p) p.UnitsInStock), _
    .Average = g.Average(Function(p) p.UnitPrice) _
    }).ToList() an exception is thrown that Count over Convert(g) is not supported. This has been fixed.
  • Optimistic concurrency control can fail - This issue can occur when the required fetch group (version fields) are not fetched upon first access of an object.
  • Enhancer removes permission attributes - Permission attributes are stored in a different way in the IL code. The enhancer does not read those attributes and they are not written to the output assembly.
  • FetchPlan Browser displays error if project has a referenced project - If a project has a reference to another project in the same solution the FetchPlan Browser cannot be used.
  • Database.Get does not work with root assembly collection if the root assemblies are not referenced - If Database.Get is called with xmltree and root assembly collection and the root assembly is not referenced directly by the calling assembly OpenAccess will not find the persistent classes.
  • GetClassId does not return the correct class id - If the class id has been changed in the mapping the method Database.GetClassId(object) returns the default value for the class id and not the one from the mapping. The runtime nevertheless works fine. The class id can be of type int or string. The Api can only return int! If the class id is set to a string value the method should throw an exception. The real classid is only set if it is necessary, if there is no class hierarchy or persistent interface the database class id will not be set. In this case the method should return 0. Otherwise the database class id should be returned. The class id can now be set in both layer. class-id is used in the api and as default for the database, db-class-id is use in the database. Both values can be accessed from the API via the new property descriptor api:

    scope.PersistentMetaData.GetPersistentTypeDescriptor(typeof(MyType)).ClassId
    scope.PersistentMetaData.GetPersistentTypeDescriptor(typeof(MyType)).DescriminatorValue
  • Dynamic LINQ returns instances of wrong type when GroupBy is used without Where clause - When in a dynamic LINQ query a group by is used without prior Where filter clause, a wrong type is returned.
  • Dynamic LINQ requires Select("it") after GroupBy() clause - When a GroupBy("key","it") was used in a dynamic LINQ query, a Select("it") had to follow in order to return the right query result.
  • Persistent interface reference throws wrong exception if reference object is not valid - Persistent references to interfaces needs a specification of valid classes. If the referenced class is a not a valid instance a null reference exception is thrown. An invalid class exception should be thrown instead.
  • MSSQL: NVARCHAR(MAX) columns do not handle Unicode values properly - When a field is mapped to a nvarchar(max) column on MSSQL, the column does not handle non-ascii Unicode characters properly and values can be truncated to '?'.
  • Nullable DateTime values not handled correctly for milliseconds - Regression to version 4.4: Nullable DateTime values are not handled correctly when millisecond values are encountered. A read value is bigger than the database content.
  • Exception is being thrown when using master/detail grids and paging is enabled - When paging is enabled on the details grid, an exception is thrown in the OpenAccessDataSourceView ExecuteSelect method.
  • Incorrect schema retrieval for procedure parameters - Some minor inconsistencies were discovered that lead to incorrect schema retrieval for stored procedure parameters. The effect is that incorrect parameter types, length, nullability was read and therefore to many schema updates were generated.
  • Grouping fails when only aggregates are projected - When only count(), max(), min() etc. are used in a projection of a grouping query, only one row is returned instead of all aggregated groups.
  • VB: Using aggregates on groups fails with exception - When using VB LINQ statements like Dim q = From c In MyBase.scope.Extent(Of Person)() _ Group c By c.Birthday Into g = Group _ Select New With {.bd = g.Max(Function(x) x.Age)} an exception is thrown."
  • VB: ConvertChecked expressions on enum values fails - Comparing an enum value produces a LINQ ConvertChecked node which was not handled correctly.
  • Generation of stored procedure name incorrect when non-default schemata are used - When stored procedures are generated by OpenAccess, the name of the SP can be wrong in cases where the table does not belong to the default schema.
  • Executing Count() extension method leads to incorrect translation when used with GroupBy - The generated query is asking for more paramters (from the group resolution) than there are.
  • Result type calculation exception when methods are used - When using methods (or properties like String.Length) in a projection calculation, an exception is thrown that the result type cannot be calculated.
  • MSSQL: Failure to store empty string values in text columns - When storing String.Empty values in columns mapped to TEXT (MSSQL), an exception occurs.
  • Reverse mapping wizard does not allow underline character inside field names - In Reverse mapping wizard and Advanced view, the 'Field name' text box refuses to change the name if it contains a '_' sign (it also refuses names starting with a digit but this is the correct behavior). Nevertheless it should be possible for a name to contain a '_' sign.
  • Forward mapping option for DateTime fields - 'set field to current date during create/update' does not update mapping entries correctly - There are two options in the Forward mapping for DateTime fields - 'set field to current date during create' - sets the value of the field to the current date while creating a new record. Mapping entry is <extension key="autoset" value="created" />. 'set field to current date during update' - sets the value of the field to the current date while updating a record. Mapping entry is <extension key="autoset" value="modified" /> If both are checked mapping entry is <extension key="autoset" value="both" /> >. If 'update' is checked first and then 'create' the mapping does not change to 'both'. All various combination of setting these 2 options should produce correct mapping
  • Using OpenAccess generated stored procedure for INSERT on a table with AUTOINC key generator, throws a MetadataException - For example - Interface for stored procedure 'sp_oa_ins_my_appointment' not sufficient to pass the value for oid column 'id_appointment' of table 'my_appointment'."
  • Reverse Mapping does not write the SQL type mapping entry for a field, into the forward mapping file (app.config) - Reverse mapping wizard writes the mapping entries for a field when the source code is generated. It does not always write the SQL type for the field. It is only written for certain conditions. Only the ado type is written. If this ado type is mapped to a different SQL type by the driver's default mapping, then we have a mismatch between the actual read in SQL type and the SQL type that will be used during run time.
  • DataSource concurrency control not working - The Microsoft Grid always returns empty string " in case of an empty edit field, the RadGrid returns a null instead. If there is an empty string in the database and the edit field is cleared in the RadGrid a concurrency control exception is thrown. The empty string and the null string should be handled as equal in the DataSource concurrency control. This does not mean that a null is stored instead of " or vice versa.
  • OpenAccessDataSource: Exceptions when there are no parameters but only command text - If you type a commandtext into the datasouce and do not specify parameters the command text is ignored.
  • cross ObjectScope references should throw descriptive exception - In some scenarios when a reference is set from one persistent object to another an exception is thrown that the object is not managed by an object scope. The right exception is that the object is managed by a different scope.
  • Enhancer cannot handle cyclic generic constraints - If generic constraints have cyclic dependencies the Microsoft Emit API can not write those classes. The OpenAccess enhancer is just throwing a stack overflow exception. We can not fix this but the enhancer should throw a descriptive exception so that the problem can be fixed from the user.
  • The Reverse mapping 'Merge' feature does not generate the 'autoinc' entry in the forward mapping - "The 'autoinc' setting for a database column is read and used for the field generated for that column. During a 'Merge' cycle, if 'autoinc' is set to 'true' on the column and this was 'false' before, this change is detected and merged into the metadata. If the class is now generated, the entry - <extension key="db-key-generator" value="AUTOINC" /> for the class is not updated. The value is saved in the reversemapping.config but not in the app.config."
  • Test connection button hides information - The test connection functionality does not display the complete information in an error case. The Exception with all inner information should be displayed.
  • MySql mapping has no NVARCHAR - The forward mapping dialog does not contain the possibility to map a string to a NVARCHAR column. The entry has to be added to the pick list. The reverse mapping wizard should be able to read the column type and generate the settings accordingly. NVARCHAR and NCHAR will generate columns with utf8 collation.
  • The code preview for a field, in the Reverse Mapping wizard, has certain required statements commented out - The Reverse mapping wizard provides a preview of the code that would be generated. The preview for a field and it's corresponding property implementation has the field and 'FieldAlias' attribute declaration commented out.
  • Forward mapping throws exception when there is a reference field in a struct. - If you have a struct that has a field that is a reference to another persistent class the reverse engineering wizard is throwing a Null Refference Exception.
  • MySql Text and Clob columns are not working - If a string is mapped to a Text, MediumText or LongText column in mysql a not implemented exception is thrown.
  • Editing 'Namespace' using textbox for locked classes crashes Reverse Mapping wizard - If a table is locked, selecting the row in the 'Simple View' grid and changing the namespace in the 'Namespace' textbox below, crashes the Reverse Mapping wizard.
  • Enhancement of VB LINQ expressions can fail when an implicit closure is used (rsp. a parameter is passed to the query) - When using a VB LINQ statement, the enhancer can fail because the generic type is not correctly detected.
  • Properties not correctly aliased to fields during design time - The FieldAlias attribute is not correctly handled and thus not visible in the designers for the DataSource.
  • If the type of a stored procedure parameter cannot be resolved the reverse mapping wizard can not be started - If a backend specific type like sql_variant is used as a stored procedure parameter the OpenAccess schema reading process fails with a cast exception, This can happen during schema migration or by starting the reverse engineering wizard.
  • If an unsupported PK column type (ex: binary PKcolumn) is reverse engineered, the wizard throws a cast exception - The reverse engineering wizard should display the proper error information. The column might be mappable to a supported type, or if that is not possible the column type has to be changed.
  • Polymorphic results of SQL queries not mapped correctly - When a polymorphic result set is returned by an SQL query, the mapping process fails as columns not mapped for the actual row are not skipped.
  • Default ordering on collections with path arguments does not work - If specifying a ordering in the mapping for a collection and you want to order by a field of an referenced object the generated SQL will not join in the right column.
  • Visual Studio addin load process is too slow - The OpenAccess addin slows down the Visual Studio startup time. This has been improved now.
  • Collection or reference fields cannot be mapped using the Reverse Mapping wizard by hand - This is a regression. A reference or a collection field can be mapped using the Reverse mapping wizard using the 'Field to Column Mapping' grid. Here a combobox was available with a list of columns in the table. These columns could be selected to specify the mapping of the PK columns for the reference/collection field. This grid is no longer visible and user cannot manually type in the string to specify the mapping.
  • A schema with a table containing an unsupported column type cannot be reverse engineered - If a schema has a table that contains a column with SQL type that is not supported it cannot be reverse engineered. Example: sql_variant in SQL Server 2005 It should be possible to reverse engineer rest of the schema objects.
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.