Skip to content

Instantly share code, notes, and snippets.

@ahall
Created August 15, 2012 15:52
Show Gist options
  • Save ahall/3361159 to your computer and use it in GitHub Desktop.
Save ahall/3361159 to your computer and use it in GitHub Desktop.
Exception:
System.NullReferenceException: Object reference not set to an instance of an object
at System.Array.Copy (System.Array sourceArray, Int32 sourceIndex, System.Array destinationArray, Int32 destinationIndex, Int32 length) [0x00000] in <filename unknown>:0
at System.Collections.ArrayList.CopyTo (Int32 index, System.Array array, Int32 arrayIndex, Int32 count) [0x00000] in <filename unknown>:0
at System.Collections.ArrayList.CopyTo (System.Array array, Int32 arrayIndex) [0x00000] in <filename unknown>:0
at System.MonoCustomAttrs.GetCustomAttributes (ICustomAttributeProvider obj, System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0
at System.MonoType.GetCustomAttributes (System.Type attributeType, Boolean inherit) [0x00000] in <filename unknown>:0
at ServiceStack.Common.ReflectionExtensions.FirstAttribute[AliasAttribute] (System.Type type, Boolean inherit) [0x00000] in <filename unknown>:0
at ServiceStack.Common.ReflectionExtensions.FirstAttribute[AliasAttribute] (System.Type type) [0x00000] in <filename unknown>:0
at ServiceStack.Common.Extensions.ReflectionExtensions.FirstAttribute[AliasAttribute] (System.Type type) [0x00000] in <filename unknown>:0
at ServiceStack.OrmLite.OrmLiteConfigExtensions.GetModelDefinition (System.Type modelType) [0x00000] in <filename unknown>:0
at ServiceStack.OrmLite.OrmLiteDialectProviderBase`1[ServiceStack.OrmLite.PostgreSQL.PostgreSQLDialectProvider].ToSelectStatement (System.Type tableType, System.String sqlFilter, System.Object[] filterParams) [0x00000] in <filename un
known>:0
at ServiceStack.OrmLite.OrmLiteReadExtensions.GetFilterSql[PollerEntity] (IDbCommand dbCmd) [0x00000] in <filename unknown>:0
at ServiceStack.OrmLite.OrmLiteReadExtensions.SetFilters[PollerEntity] (IDbCommand dbCmd, System.Object anonType, Boolean excludeNulls) [0x00000] in <filename unknown>:0
at ServiceStack.OrmLite.OrmLiteReadExtensions.QuerySingle[PollerEntity] (IDbCommand dbCmd, System.Object anonType) [0x00000] in <filename unknown>:0
at Mosaic.Poller.Daemon.MainClass+<OnCheckInPerfDataRequest>c__AnonStorey2.<>m__4 () [0x00068] in /Users/ahall/Projects/mosaic-backend/src/Mosaic.Poller.Daemon/Main.cs:304
What I'm doing is running the following code inside a task which end up being executed concurrently:
using (var dbConn = mosaicDbFactory.OpenDbConnection())
using (var dbCmd = dbConn.CreateCommand())
using (var transaction = dbCmd.BeginTransaction())
{
var poller = dbCmd.QuerySingle<PollerEntity>(new { common_name = commonName });
...
}
Its crashing on the QuerySingle() statement but only if its being executed by multiple tasks at the same time by the looks of it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment