XPO - Important Changes to Default Query Parameter Validation (v20.1)

XPO Team Blog
21 May 2020

Problem

We recently documented the following changes in v20.1.3:

Unfortunately, we failed to anticipate the scope of query parameter inconsistencies within customer apps (EAP/Beta feedback did not uncover this issue). Despite benefits associated with our changes, we do not want to force XPO users to modify their code immediately or revert to previous behavior manually (with feature toggles).

Solution

We softened default parameter validation with regard to SELECT, UPDATE, and INSERT statements in our v20.1.4 release.
We introduced a new DevExpress.Xpo.DB.QueryParameterMode enumeration with the following values:

  • Legacy: for v19.2 and older versions.
  • SetType (Default): will only validate parameter type without size. Will preserve all performance optimizations. SetType will still catch errors such as Guid parameter comparisons with strings (learn more).
  • SetTypeAndSize: will validate type and size. It will be automatically set for MSSqlConnectionProvider and Always Encrypted).

You can set the ConnectionProviderSql.QueryParameterMode property or the ConnectionProviderSql.GlobalQueryParameterMode static property as needed. Example:

using DevExpress.Xpo.DB;
//...
ConnectionProviderSql.GlobalQueryParameterMode = QueryParameterMode.Legacy;

The majority of XPO users will not need to modify this behavior, because new defaults should address most requirements.

Feedback

Please test a new build and let us know how this solution works for you.

What’s New in v20.1

To explore the scope, breadth and capabilities of our new products/features, please visit: https://www.devexpress.com/Subscriptions/New-2020-1.xml.
No Comments

Please login or register to post comments.