Ticket T579483
Visible to All Users

Cache node usage with the new middle-tier implementation in v17.2

created 7 years ago

[DevExpress Support Team: CLONED FROM T570966: How to migrate to the new Middle-Tier implementation after upgrading to XAF v17.2+]

Hi,

Can you please confirm the correct usage of cache node:

C#
Func<IDataLayer> dataLayerProvider = () => { // enable data cache store var mainDataStore = XpoDefault.GetConnectionProvider(connectionString, AutoCreateOption.DatabaseAndSchema); var root = new DataCacheRoot(mainDataStore); var node = new DataCacheNode(root); var dataLayer = new ThreadSafeDataLayer(XpoTypesInfoHelper.GetXpoTypeInfoSource().XPDictionary, node); return dataLayer; }; Func<IDataServerSecurity> dataServerSecurityProvider = () => { SecurityStrategyComplex security = new SecurityStrategyComplex(typeof(PermissionPolicyUser), typeof(PermissionPolicyRole), new AuthenticationStandard()); security.SupportNavigationPermissionsForTypes = false; return security; }; WcfXafServiceHost serviceHost = new WcfXafServiceHost(dataLayerProvider, dataServerSecurityProvider, true, InstanceContextMode.PerSession); serviceHost.AddServiceEndpoint(typeof(IWcfXafDataServer), WcfDataServerHelper.CreateNetTcpBinding(), "net.tcp://127.0.0.1:1451/DataServer");
Comments (1)
DevExpress Support Team 7 years ago

    Hello Maxime,

    We need additional time to find an appropriate solution for you. Please bear with us.

    Answers approved by DevExpress Support

    created 7 years ago

    In order for the caching system to work correctly in the new middle-tier implementation, you need to create a DataCacheRoot and DataCacheNode outside the dataLayer provider function. See the code below for more information:

    C#
    ... var mainDataStore = XpoDefault.GetConnectionProvider(connectionString, AutoCreateOption.SchemaAlreadyExists); var root = new DataCacheRoot(mainDataStore); var node = new DataCacheNode(root); Func<IDataLayer> dataLayerProvider = () => new ThreadSafeDataLayer(XpoTypesInfoHelper.GetXpoTypeInfoSource().XPDictionary, node); ...

    AutoCreateOption.SchemaAlreadyExists - This parameter reduces the number of queries sent to DataBase bypass the caching system

    See also:
    Cached Data Store

      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.