Skip to content

Commit

Permalink
Fixed problem that SqlServer-unicode fix changed DefaultStringLength …
Browse files Browse the repository at this point in the history
…for Oracle
  • Loading branch information
mattiasw2 committed Feb 5, 2013
1 parent 67a0802 commit 24a344b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,24 @@ public override bool DoesTableExist(IDbCommand dbCmd, string tableName)
var result = dbCmd.GetLongScalar();

return result > 0;
}
}

public override bool UseUnicode
{
get
{
return useUnicode;
}
set
{
useUnicode = value;
if (useUnicode && this.DefaultStringLength > 4000)
{
this.DefaultStringLength = 4000;
}

// UpdateStringColumnDefinitions(); is called by changing DefaultStringLength
}
}
}
}
7 changes: 1 addition & 6 deletions src/ServiceStack.OrmLite/OrmLiteDialectProviderBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public string ParamString
set { paramString = value; }
}

private bool useUnicode;
protected bool useUnicode;
public virtual bool UseUnicode
{
get
Expand Down Expand Up @@ -182,11 +182,6 @@ private void UpdateStringColumnDefinitions()
? StringLengthUnicodeColumnDefinitionFormat
: StringLengthNonUnicodeColumnDefinitionFormat;


this.defaultStringLength = useUnicode
? 4000
: 8000;

this.StringColumnDefinition = string.Format(
this.StringLengthColumnDefinitionFormat, DefaultStringLength);

Expand Down

0 comments on commit 24a344b

Please sign in to comment.