public CachedDataStoreProvider(string connectionString, IDbConnection connection, bool enablePoolingInConnectionString) { if (xpoDataStoreProvider == null) { xpoDataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, enablePoolingInConnectionString); } }
private IXpoDataStoreProvider GetDataStoreProvider(string connectionString, System.Data.IDbConnection connection) { System.Web.HttpApplicationState application = (System.Web.HttpContext.Current != null) ? System.Web.HttpContext.Current.Application : null; IXpoDataStoreProvider dataStoreProvider = null; if (application != null && application["DataStoreProvider"] != null) { dataStoreProvider = application["DataStoreProvider"] as IXpoDataStoreProvider; } else { dataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, true); if (application != null) { application["DataStoreProvider"] = dataStoreProvider; } } return(dataStoreProvider); // IXpoDataStoreProvider dataStoreProvider = null; // if(!String.IsNullOrEmpty(connectionString)) { // dataStoreProvider = new ConnectionStringDataStoreProvider(connectionString); // } // else if(connection != null) { // dataStoreProvider = new ConnectionDataStoreProvider(connection); // } //return dataStoreProvider; }
public static IXpoDataStoreProvider GetDataStoreProvider(string connectionString, IDbConnection connection, bool enablePoolingInConnectionString = true) { if (UseSQLAlternativeInfoSingleton.Instance.UseAlternative) { connectionString = InMemoryDataStoreProvider.ConnectionString; } if (connection != null) { connectionString = null; } else { if ((connectionString != InMemoryDataStoreProvider.ConnectionString) && !string.IsNullOrEmpty(connectionString) && !DemoDbEngineDetectorHelper.IsSqlServerAccessible(connectionString)) { string patchedConnectionString = DemoDbEngineDetectorHelper.PatchSQLConnectionString(connectionString); if ((patchedConnectionString == DemoDbEngineDetectorHelper.AlternativeConnectionString) || !DemoDbEngineDetectorHelper.IsSqlServerAccessible(patchedConnectionString)) { UseSQLAlternativeInfoSingleton.Instance.FillFields(DemoDbEngineDetectorHelper.GetIssueMessage(patchedConnectionString), DemoXPODatabaseHelper.AlternativeName, DemoXPODatabaseHelper.InMemoryDatabaseUsageMessage); patchedConnectionString = InMemoryDataStoreProvider.ConnectionString; } connectionString = patchedConnectionString; } } return(XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, enablePoolingInConnectionString)); }
public IXpoDataStoreProvider GetDataStoreProvider(string connectionString, IDbConnection connection, bool enablePoolingInConnectionString) { if (dataStoreProvider == null) { dataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, enablePoolingInConnectionString); } return(dataStoreProvider); }
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { IXpoDataStoreProvider dataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true); args.ObjectSpaceProvider = new XPObjectSpaceProvider(dataStoreProvider, true);// TestListViewController requires a thread-safe DAL args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); GenerateUserFriendlyId.Module.SequenceGenerator.Initialize(dataStoreProvider); }
public IXpoDataStoreProvider GetDataStoreProvider() { if (dataStoreProvider == null) { dataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, null, true); } return(dataStoreProvider); }
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false)); args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); GlobalVar.LabelPrinterName = Properties.Settings.Default.LabelPrinterName; GlobalVar.DCPrinterName = Properties.Settings.Default.DCPrinterName; }
public static IXpoDataStoreProvider GetDataStoreProvider(IDbConnection connection, bool enablePoolingInConnectionString) { if (dataStoreProvider == null) { string connectionString = ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString; dataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, enablePoolingInConnectionString); } return(dataStoreProvider); }
private IXpoDataStoreProvider GetDataStoreProvider(string connectionString, System.Data.IDbConnection connection) { var accessor = ServiceProvider.GetRequiredService <XpoDataStoreProviderAccessor>(); lock (accessor) { accessor.DataStoreProvider ??= XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, true); } return(accessor.DataStoreProvider); }
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { _ = args ?? throw new ArgumentNullException(nameof(args)); args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider( XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), true )); args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); }
public IXpoDataStoreProvider GetDataStoreProvider(string connectionString, IDbConnection connection) { return(xpoDataStoreProviderDictionary.GetOrAdd(connectionString, CreateDataStoreProvider)); IXpoDataStoreProvider CreateDataStoreProvider(string connectionString) { //TODO Minakov the enablePoolingInConnectionString parameter should be true. Change after IObjectSpace.DataBase fix return(XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, false)); } }
private IXpoDataStoreProvider GetDataStoreProvider(string connectionString, System.Data.IDbConnection connection) { useMemoryStore = false; XpoDataStoreProviderAccessor accessor = ServiceProvider.GetRequiredService <XpoDataStoreProviderAccessor>(); lock (accessor) { if (accessor.DataStoreProvider == null) { accessor.DataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, !useMemoryStore); } } return(accessor.DataStoreProvider); }
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { //args.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((SecurityStrategyComplex)Security, XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false)); //args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); XpoDefault.TrackPropertiesModifications = true; IXpoDataStoreProvider dataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true); args.ObjectSpaceProvider = new XPObjectSpaceProvider(dataStoreProvider, true);// TestListViewController requires a thread-safe DAL args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); SequenceGenerator.Initialize(dataStoreProvider); }
private IXpoDataStoreProvider GetDataStoreProvider(string connectionString, System.Data.IDbConnection connection) { System.Web.HttpApplicationState application = (System.Web.HttpContext.Current != null) ? System.Web.HttpContext.Current.Application : null; IXpoDataStoreProvider dataStoreProvider = null; if(application != null && application["DataStoreProvider"] != null) { dataStoreProvider = application["DataStoreProvider"] as IXpoDataStoreProvider; } else { dataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, true); if(application != null) { application["DataStoreProvider"] = dataStoreProvider; } } return dataStoreProvider; }
private IXpoDataStoreProvider GetDataStoreProvider(string connectionString, System.Data.IDbConnection connection) { IXpoDataStoreProvider xpoDataStoreProvider; lock (xpoDataStoreProviderDictionary) { if (!xpoDataStoreProviderDictionary.TryGetValue(connectionString, out xpoDataStoreProvider)) { //TODO Minakov the enablePoolingInConnectionString parameter should be true. Change after IObjectSpace.DataBase fix xpoDataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, false); xpoDataStoreProviderDictionary[connectionString] = xpoDataStoreProvider; } } return(xpoDataStoreProvider); }
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { IObjectSpaceProvider provider; if (dxTestSolution.Module.dxTestSolutionModule.UseInMemoryStore) { provider = new XPObjectSpaceProvider(InMemoryDataStoreProvider.ConnectionString, null, false); } else { provider = new XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false); } //secur#9 args.ObjectSpaceProviders.Add(provider); args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); }
private IXpoDataStoreProvider GetDataStoreProvider(string connectionString, IDbConnection connection) { var application = HttpContext.Current != null ? HttpContext.Current.Application : null; IXpoDataStoreProvider dataStoreProvider; if (application?["DataStoreProvider"] != null) { dataStoreProvider = application["DataStoreProvider"] as IXpoDataStoreProvider; } else { dataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, true); if (application != null) { application["DataStoreProvider"] = dataStoreProvider; } } return(dataStoreProvider); }
public static IXpoDataStoreProvider GetDataStoreProvider(string connectionString, IDbConnection connection, bool enablePoolingInConnectionString = true) { IXpoDataStoreProvider xpoDataStoreProvider = null; if (UseSQLAlternativeInfoSingleton.Instance.UseAlternative || (connectionString == InMemoryDataStoreProvider.ConnectionString)) { xpoDataStoreProvider = DemoXPODatabaseHelper.GetInMemoryDataStoreProvider(enablePoolingInConnectionString); } else { if ((connection != null) || DemoDbEngineDetectorHelper.IsSqlServerAccessible(connectionString)) { xpoDataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, enablePoolingInConnectionString); } else { UseSQLAlternativeInfoSingleton.Instance.FillFields(DemoDbEngineDetectorHelper.DBServerIsNotAccessibleMessage, DemoXPODatabaseHelper.AlternativeName, DemoXPODatabaseHelper.InMemoryDatabaseUsageMessage); xpoDataStoreProvider = DemoXPODatabaseHelper.GetInMemoryDataStoreProvider(enablePoolingInConnectionString); } } return(xpoDataStoreProvider); }
public CustomIXpoDataStoreProvider(string connectionString, IDbConnection connection, bool enablePoolingInConnectionString) { innerDataStoreProvider = XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, enablePoolingInConnectionString); }
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(InMemoryDataStoreProvider.ConnectionString, args.Connection, true), false)); args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); }
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { args.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((SecurityStrategyComplex)Security, XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false)); args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); #region allow store proc ((SecuredObjectSpaceProvider)args.ObjectSpaceProvider).AllowICommandChannelDoWithSecurityContext = true; #endregion }
private IXpoDataStoreProvider GetDataStoreProvider(string connectionString, System.Data.IDbConnection connection) { //TODO SPA return(XPObjectSpaceProvider.GetDataStoreProvider(connectionString, connection, true)); }
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(ConfigurationManager.ConnectionStrings["ConnectionStringXpo"].ConnectionString, null, true), false)); args.ObjectSpaceProviders.Add(new EFObjectSpaceProvider(typeof(SimpleProjectManagerDbContext), ConfigurationManager.ConnectionStrings["ConnectionStringEF"].ConnectionString)); args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); }
public static IXpoDataStoreProvider GetInMemoryDataStoreProvider(bool enablePoolingInConnectionString) { return(XPObjectSpaceProvider.GetDataStoreProvider(InMemoryDataStoreProvider.ConnectionString, null, enablePoolingInConnectionString)); }
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { args.ObjectSpaceProviders.Add(new SecuredObjectSpaceProvider((SecurityStrategyComplex)Security, XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false)); args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); }
protected override void CreateDefaultObjectSpaceProvider(CreateCustomObjectSpaceProviderEventArgs args) { // Zakomentowanie poniższej linii gwarantuje, że żadna baza danych nie będzie tworzona podczas włączenia aplikacji args.ObjectSpaceProviders.Add(new XPObjectSpaceProvider(XPObjectSpaceProvider.GetDataStoreProvider(args.ConnectionString, args.Connection, true), false)); args.ObjectSpaceProviders.Add(new NonPersistentObjectSpaceProvider(TypesInfo, null)); }