CommitTimeout

This commit is contained in:
christianwade 2016-12-20 00:34:25 -08:00
parent 3c5b1a1347
commit 4aacdb93ff
6 changed files with 16 additions and 5 deletions

View File

@ -82,6 +82,7 @@ namespace AsPartitionProcessing.SampleClient
integratedAuth: true, integratedAuth: true,
userName: "", userName: "",
password: "", password: "",
commitTimeout: -1,
tableConfigurations: tableConfigurations:
new List<TableConfiguration> new List<TableConfiguration>
{ {

View File

@ -32,6 +32,7 @@ namespace AsPartitionProcessing
,[IncrementalOnline] ,[IncrementalOnline]
,[IncrementalParallelTables] ,[IncrementalParallelTables]
,[IntegratedAuth] ,[IntegratedAuth]
,[CommitTimeout]
,[TableConfigurationID] ,[TableConfigurationID]
,[AnalysisServicesTable] ,[AnalysisServicesTable]
,[Partitioned] ,[Partitioned]
@ -71,6 +72,7 @@ namespace AsPartitionProcessing
modelConfig.IncrementalOnline = Convert.ToBoolean(reader["IncrementalOnline"]); modelConfig.IncrementalOnline = Convert.ToBoolean(reader["IncrementalOnline"]);
modelConfig.IncrementalParallelTables = Convert.ToBoolean(reader["IncrementalParallelTables"]); modelConfig.IncrementalParallelTables = Convert.ToBoolean(reader["IncrementalParallelTables"]);
modelConfig.IntegratedAuth = Convert.ToBoolean(reader["IntegratedAuth"]); modelConfig.IntegratedAuth = Convert.ToBoolean(reader["IntegratedAuth"]);
modelConfig.CommitTimeout = Convert.ToInt32(reader["CommitTimeout"]);
modelConfig.ConfigDatabaseConnectionInfo = connectionInfo; modelConfig.ConfigDatabaseConnectionInfo = connectionInfo;
currentModelConfigurationID = modelConfig.ModelConfigurationID; currentModelConfigurationID = modelConfig.ModelConfigurationID;

View File

@ -53,6 +53,11 @@ namespace AsPartitionProcessing
/// </summary> /// </summary>
public string Password { get; set; } public string Password { get; set; }
/// <summary>
/// Set to override of CommitTimeout server property value for the connection. -1 will not override; the server value will be used.
/// </summary>
public int CommitTimeout { get; set; }
/// <summary> /// <summary>
/// Collection of partitioned tables containing configuration information. /// Collection of partitioned tables containing configuration information.
/// </summary> /// </summary>
@ -91,6 +96,7 @@ namespace AsPartitionProcessing
bool integratedAuth, bool integratedAuth,
string userName, string userName,
string password, string password,
int commitTimeout,
List<TableConfiguration> tableConfigurations List<TableConfiguration> tableConfigurations
) )
{ {
@ -103,6 +109,7 @@ namespace AsPartitionProcessing
IntegratedAuth = integratedAuth; IntegratedAuth = integratedAuth;
UserName = userName; UserName = userName;
Password = password; Password = password;
CommitTimeout = commitTimeout;
TableConfigurations = tableConfigurations; TableConfigurations = tableConfigurations;
ExecutionID = Guid.NewGuid().ToString(); ExecutionID = Guid.NewGuid().ToString();
} }

View File

@ -495,12 +495,10 @@ namespace AsPartitionProcessing
private static void Connect(Server server, out Database database) private static void Connect(Server server, out Database database)
{ {
//Connect and get main objects //Connect and get main objects
string serverConnectionString; string serverConnectionString = $"Provider=MSOLAP;{(_modelConfiguration.CommitTimeout == -1 ? "" : $"CommitTimeout={Convert.ToString(_modelConfiguration.CommitTimeout)};")}Data Source={_modelConfiguration.AnalysisServicesServer};";
if (_modelConfiguration.IntegratedAuth) if (!_modelConfiguration.IntegratedAuth)
serverConnectionString = $"Provider=MSOLAP;Data Source={_modelConfiguration.AnalysisServicesServer};";
else
{ {
serverConnectionString = $"Provider=MSOLAP;Data Source={_modelConfiguration.AnalysisServicesServer};User ID={_modelConfiguration.UserName};Password={_modelConfiguration.Password};Persist Security Info=True;Impersonation Level=Impersonate;"; serverConnectionString += $"User ID={_modelConfiguration.UserName};Password={_modelConfiguration.Password};Persist Security Info=True;Impersonation Level=Impersonate;";
} }
server.Connect(serverConnectionString); server.Connect(serverConnectionString);

View File

@ -11,6 +11,7 @@ CREATE TABLE [dbo].[ModelConfiguration](
[IncrementalOnline] [bit] NOT NULL, [IncrementalOnline] [bit] NOT NULL,
[IncrementalParallelTables] [bit] NOT NULL, [IncrementalParallelTables] [bit] NOT NULL,
[IntegratedAuth] [bit] NOT NULL, [IntegratedAuth] [bit] NOT NULL,
[CommitTimeout] [int] NOT NULL,
CONSTRAINT [PK_ModelConfiguration] PRIMARY KEY CLUSTERED CONSTRAINT [PK_ModelConfiguration] PRIMARY KEY CLUSTERED
( (
[ModelConfigurationID] ASC [ModelConfigurationID] ASC
@ -106,6 +107,7 @@ SELECT m.[ModelConfigurationID]
,m.[IncrementalOnline] ,m.[IncrementalOnline]
,m.[IncrementalParallelTables] ,m.[IncrementalParallelTables]
,m.[IntegratedAuth] ,m.[IntegratedAuth]
,m.[CommitTimeout]
,t.[TableConfigurationID] ,t.[TableConfigurationID]
,t.[AnalysisServicesTable] ,t.[AnalysisServicesTable]
,t.[DoNotProcess] ,t.[DoNotProcess]

View File

@ -7,6 +7,7 @@ VALUES(
,1 --[IncrementalOnline] ,1 --[IncrementalOnline]
,1 --[IncrementalParallelTables] ,1 --[IncrementalParallelTables]
,1 --[IntegratedAuth] ,1 --[IntegratedAuth]
,-1 --[CommitTimeout]
); );
INSERT INTO [dbo].[TableConfiguration] INSERT INTO [dbo].[TableConfiguration]