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,
userName: "",
password: "",
commitTimeout: -1,
tableConfigurations:
new List<TableConfiguration>
{

View File

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

View File

@ -53,6 +53,11 @@ namespace AsPartitionProcessing
/// </summary>
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>
/// Collection of partitioned tables containing configuration information.
/// </summary>
@ -91,6 +96,7 @@ namespace AsPartitionProcessing
bool integratedAuth,
string userName,
string password,
int commitTimeout,
List<TableConfiguration> tableConfigurations
)
{
@ -103,6 +109,7 @@ namespace AsPartitionProcessing
IntegratedAuth = integratedAuth;
UserName = userName;
Password = password;
CommitTimeout = commitTimeout;
TableConfigurations = tableConfigurations;
ExecutionID = Guid.NewGuid().ToString();
}

View File

@ -495,12 +495,10 @@ namespace AsPartitionProcessing
private static void Connect(Server server, out Database database)
{
//Connect and get main objects
string serverConnectionString;
if (_modelConfiguration.IntegratedAuth)
serverConnectionString = $"Provider=MSOLAP;Data Source={_modelConfiguration.AnalysisServicesServer};";
else
string serverConnectionString = $"Provider=MSOLAP;{(_modelConfiguration.CommitTimeout == -1 ? "" : $"CommitTimeout={Convert.ToString(_modelConfiguration.CommitTimeout)};")}Data Source={_modelConfiguration.AnalysisServicesServer};";
if (!_modelConfiguration.IntegratedAuth)
{
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);

View File

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

View File

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