Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix for SQL Server Ce max payload of 8000 #155

Merged
merged 1 commit into from

2 participants

@Jonne

Fix for the following issue:

#136

It feels a bit like a hack, but we have to explicitly set the type of the parameter to Image, so I don't see another way.

@damianh damianh was assigned
@damianh damianh merged commit 4569453 into NEventStore:master
@damianh damianh referenced this pull request from a commit in damianh/NEventStore
@damianh damianh Failing test that repros issue #155 175a2ab
@damianh damianh referenced this pull request from a commit in damianh/NEventStore
@damianh damianh Fix for issue #155. Incorporated the gist code to only return commits…
… up to (but not including) end date.
381640f
@damianh damianh removed their assignment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 12, 2013
This page is out of date. Refresh to see the latest.
View
16 src/proj/EventStore.Persistence.SqlPersistence/SqlDialects/SqlCeDialect.cs
@@ -1,3 +1,5 @@
+using System.Reflection;
+
namespace EventStore.Persistence.SqlPersistence.SqlDialects
{
using System;
@@ -70,6 +72,20 @@ private class SqlCeDbStatement : DelimitedDbStatement
: base(dialect, scope, connection, transaction)
{
}
+
+ protected override void SetParameterValue(IDataParameter param, object value, DbType? type)
+ {
+ base.SetParameterValue(param, value, null);
+
+ // SQL CE Binary has a size limit of 8000. We have to explicitely set the type of the parameter to SqlDbType.Image
+ // to be able to support a larger payload.
+ if (param.DbType == DbType.Binary)
+ {
+ param.GetType().InvokeMember("SqlDbType",
+ BindingFlags.Instance | BindingFlags.Public | BindingFlags.SetProperty,
+ Type.DefaultBinder, param, new object[] { SqlDbType.Image });
+ }
+ }
}
}
}
Something went wrong with that request. Please try again.