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.

Showcase Your Apps on DevExpress.com

Highlight your business app and share your development experiences with the DevExpress community. To include your app in our upcoming App Showcase, please forward an application screenshot to clientservices@devexpress.com and tell us which DevExpress products you currently use within your organization.
No Comments

Please login or register to post comments.