Skip to content

Commit 93d7246

Browse files
Document timeout value unit.
- Fixes #769 ( NH-3922 )
1 parent 2161518 commit 93d7246

15 files changed

+69
-24
lines changed

src/NHibernate/Async/Driver/IResultSetsCommand.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ namespace NHibernate.Driver
1717
using System.Threading;
1818
public partial interface IResultSetsCommand
1919
{
20+
/// <summary>
21+
/// Get a data reader for this multiple result sets command.
22+
/// </summary>
23+
/// <param name="commandTimeout">The timeout in seconds for the underlying ADO.NET query.</param>
24+
/// <param name="cancellationToken">A cancellation token that can be used to cancel the work</param>
25+
/// <returns>A data reader.</returns>
2026
Task<DbDataReader> GetReaderAsync(int? commandTimeout, CancellationToken cancellationToken);
2127
}
22-
}
28+
}

src/NHibernate/Cfg/Environment.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,9 @@ public static string Version
193193

194194
// NHibernate-specific properties
195195
public const string PrepareSql = "prepare_sql";
196+
/// <summary>
197+
/// Set the default timeout in seconds for ADO.NET queries.
198+
/// </summary>
196199
public const string CommandTimeout = "command_timeout";
197200

198201
public const string PropertyBytecodeProvider = "bytecode.provider";

src/NHibernate/Cfg/Loquacious/IDbIntegrationConfigurationProperties.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@ public interface IDbIntegrationConfigurationProperties
2929
void TransactionFactory<TFactory>() where TFactory : ITransactionFactory;
3030

3131
bool PrepareCommands { set; }
32+
/// <summary>
33+
/// Set the default timeout in seconds for ADO.NET queries.
34+
/// </summary>
3235
byte Timeout { set; }
3336
void ExceptionConverter<TExceptionConverter>() where TExceptionConverter : ISQLExceptionConverter;
3437
bool AutoCommentSql { set; }
@@ -39,4 +42,4 @@ public interface IDbIntegrationConfigurationProperties
3942

4043
void QueryModelRewriterFactory<TFactory>() where TFactory : IQueryModelRewriterFactory;
4144
}
42-
}
45+
}

src/NHibernate/Cfg/Loquacious/INamedQueryDefinitionBuilder.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ public interface INamedQueryDefinitionBuilder
88
bool IsCacheable { get; set; }
99
string CacheRegion { get; set; }
1010
int FetchSize { get; set; }
11+
/// <summary>
12+
/// The timeout in seconds for the underlying ADO.NET query.
13+
/// </summary>
1114
int Timeout { get; set; }
1215
FlushMode FlushMode { get; set; }
1316
string Query { get; set; }
@@ -76,4 +79,4 @@ public NamedQueryDefinition Build()
7679
return new NamedQueryDefinition(Query, IsCacheable, CacheRegion, Timeout, FetchSize, FlushMode, CacheMode ,IsReadOnly, Comment, new Dictionary<string, string>(1));
7780
}
7881
}
79-
}
82+
}

src/NHibernate/Driver/IResultSetsCommand.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ public partial interface IResultSetsCommand
88
void Append(ISqlCommand command);
99
bool HasQueries { get; }
1010
SqlString Sql { get; }
11+
/// <summary>
12+
/// Get a data reader for this multiple result sets command.
13+
/// </summary>
14+
/// <param name="commandTimeout">The timeout in seconds for the underlying ADO.NET query.</param>
15+
/// <returns>A data reader.</returns>
1116
DbDataReader GetReader(int? commandTimeout);
1217
}
13-
}
18+
}

src/NHibernate/Engine/RowSelection.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ public int MaxRows
4242
}
4343

4444
/// <summary>
45-
/// Gets or Sets the Timeout of the Query
45+
/// The timeout in seconds for the underlying ADO.NET query.
4646
/// </summary>
47-
/// <value>The Query Timeout</value>
48-
/// <remarks>Defaults to NoValue unless specifically set.</remarks>
47+
/// <value>The query timeout in seconds.</value>
48+
/// <remarks>Defaults to <see cref="NoValue" /> unless specifically set.</remarks>
4949
public int Timeout
5050
{
5151
get { return timeout; }
@@ -63,4 +63,4 @@ public bool DefinesLimits
6363
get { return maxRows != NoValue || firstRow > 0; }
6464
}
6565
}
66-
}
66+
}

src/NHibernate/ICriteria.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,10 +246,10 @@ public partial interface ICriteria : ICloneable
246246
ICriteria SetFetchSize(int fetchSize);
247247

248248
/// <summary>
249-
/// Set a timeout for the underlying ADO.NET query
249+
/// Set a timeout for the underlying ADO.NET query.
250250
/// </summary>
251-
/// <param name="timeout"></param>
252-
/// <returns></returns>
251+
/// <param name="timeout">The timeout in seconds.</param>
252+
/// <returns><see langword="this" /> (for method chaining).</returns>
253253
ICriteria SetTimeout(int timeout);
254254

255255
/// <summary>

src/NHibernate/IDetachedQuery.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,10 @@ public interface IDetachedQuery
4848
IDetachedQuery SetReadOnly(bool readOnly);
4949

5050
/// <summary>
51-
/// The timeout for the underlying ADO query
51+
/// Set a timeout for the underlying ADO.NET query.
5252
/// </summary>
53-
/// <param name="timeout"></param>
53+
/// <param name="timeout">The timeout in seconds.</param>
54+
/// <returns><see langword="this" /> (for method chaining).</returns>
5455
IDetachedQuery SetTimeout(int timeout);
5556

5657
/// <summary> Set a fetch size for the underlying ADO query.</summary>

src/NHibernate/IMultiCriteria.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,11 @@ public static class MultiCriteriaExtensions
161161
{
162162
//6.0 TODO: Convert to interface method
163163
/// <summary>
164-
/// Set a timeout for the underlying ADO.NET query
164+
/// Set a timeout for the underlying ADO.NET query.
165165
/// </summary>
166+
/// <param name="timeout">The timeout in seconds.</param>
167+
/// <param name="multiCriteria">The <see cref="IMultiCriteria" /> on which to set the timeout.</param>
168+
/// <returns><paramref name="multiCriteria" /> (for method chaining).</returns>
166169
public static IMultiCriteria SetTimeout(this IMultiCriteria multiCriteria, int timeout)
167170
{
168171
if (multiCriteria == null)

src/NHibernate/IMultiQuery.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ public partial interface IMultiQuery
144144
IMultiQuery SetForceCacheRefresh(bool forceCacheRefresh);
145145

146146
/// <summary>
147-
/// The timeout for the underlying ADO query
147+
/// Set a timeout for the underlying ADO.NET query.
148148
/// </summary>
149-
/// <param name="timeout"></param>
149+
/// <param name="timeout">The timeout in seconds.</param>
150150
/// <returns>The instance for method chain.</returns>
151151
IMultiQuery SetTimeout(int timeout);
152152

0 commit comments

Comments
 (0)