Skip to content

Commit 03eb58a

Browse files
committed
Explicitly set parameter sizes - prevent query cache plan per each actual parameter size
SVN: trunk@4915
1 parent 5770b20 commit 03eb58a

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/NHibernate.Test/SqlTest/Identity/MsSQL/MSSQLIdentityInsertWithStoredProcsTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected override bool AppliesTo(Dialect.Dialect dialect)
1414

1515
protected override string GetExpectedInsertOrgLogStatement(string orgName)
1616
{
17-
return string.Format("exec nh_organization_native_id_insert @p0;@p0 = '{0}' [Type: String ({1})]", orgName, orgName.Length);
17+
return string.Format("exec nh_organization_native_id_insert @p0;@p0 = '{0}' [Type: String (4000)]", orgName);
1818
}
1919

2020
protected override IList Mappings

src/NHibernate/Driver/OdbcDriver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ public static void SetParameterSizes(IDataParameterCollection parameters, SqlTyp
6969
public override IDbCommand GenerateCommand(CommandType type, SqlString sqlString, SqlType[] parameterTypes)
7070
{
7171
IDbCommand command = base.GenerateCommand(type, sqlString, parameterTypes);
72-
if (IsPrepareSqlEnabled)
72+
//if (IsPrepareSqlEnabled)
7373
{
7474
SetParameterSizes(command.Parameters, parameterTypes);
7575
}

src/NHibernate/Driver/SqlClientDriver.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ private static void SetVariableLengthParameterSize(IDbDataParameter dbParam, Sql
153153
public override IDbCommand GenerateCommand(CommandType type, SqlString sqlString, SqlType[] parameterTypes)
154154
{
155155
IDbCommand command = base.GenerateCommand(type, sqlString, parameterTypes);
156-
if (IsPrepareSqlEnabled)
156+
//if (IsPrepareSqlEnabled)
157157
{
158158
SetParameterSizes(command.Parameters, parameterTypes);
159159
}

0 commit comments

Comments
 (0)