Hi,
I am using latest version of MarcelloDB - 1.0.8 and getting an exception (intermittently) on following scenarios -
- FindAll()
public IEnumerable FindAll(Func<T, bool> predicate)
{
lock (_lockSessionAccess)
{
return GetCollection().All.Where(predicate);
}
}
- Add()
public virtual void Add(T entity, bool autoflush = true)
{
lock (_lockSessionAccess)
{
GetCollection().Persist(entity);
if (autoflush) Flush();
}
}
Exception Stack Trace -
Exception:System.InvalidOperationException: Cannot read Int64 as Bool
at MarcelloDB.Serialization.BinaryFormatter.ReadValidTypeID (MarcelloDB.Serialization.BinaryFormatter+TypeID wantedTypeID) [0x0003b] in :0
at MarcelloDB.Serialization.BinaryFormatter.ReadBool () [0x00001] in :0
at MarcelloDB.Serialization.ValueSerializers.BooleanSerializer.ReadValue (MarcelloDB.Serialization.BinaryFormatter formatter) [0x00001] in :0
at MarcelloDB.Serialization.BTreeNodeBinaryFormatterSerializer1[TKey].ReadEntry (MarcelloDB.Serialization.BinaryFormatter formatter) [0x0001b] in <ce43c20e305646cf958407e87464f571>:0 at MarcelloDB.Serialization.BTreeNodeBinaryFormatterSerializer1[TKey].ReadEntries (MarcelloDB.Serialization.BinaryFormatter formatter) [0x00013] in :0
at MarcelloDB.Serialization.BTreeNodeBinaryFormatterSerializer1[TKey].Deserialize (System.Byte[] bytes) [0x00023] in <ce43c20e305646cf958407e87464f571>:0 at MarcelloDB.Index.BTree.RecordBTreeDataProvider1[TNodeKey].GetNode (System.Int64 address) [0x0003a] in :0
at MarcelloDB.Index.BTree.RecordBTreeDataProvider1[TNodeKey].GetRootNode (System.Int32 degree) [0x00040] in <ce43c20e305646cf958407e87464f571>:0 at MarcelloDB.Index.BTree.BTreeWalker1[TK].Reset () [0x00022] in :0
at MarcelloDB.Index.BTree.BTreeWalker1[TK]..ctor (System.Int32 degree, MarcelloDB.Index.BTree.IBTreeDataProvider1[TK] dataProvider) [0x00024] in :0
at MarcelloDB.Index.RecordIndex1[TNodeKey].GetWalker () [0x00008] in <ce43c20e305646cf958407e87464f571>:0 at MarcelloDB.Collections.BaseIndexedValue2[TObj,TAttribute].EnsureIndex () [0x00045] in :0
at MarcelloDB.Collections.Collection2[T,TID].Initialize () [0x0001e] in <ce43c20e305646cf958407e87464f571>:0 at MarcelloDB.Collections.CollectionFile.Collection[T,TID,TIndexDef] (System.String collectionName, System.Func2[T,TResult] idFunc) [0x0005a] in :0
at TXX.Xamarin.Forms.Persistence.NoSQL.Abstract.IndexedRepositoryBase3[T,TKey,TIndex].GetCollection () [0x00012] in <ba352e7d3b8c4296ac040d6fc327dc5c>:0 at TXX.Xamarin.Forms.Persistence.NoSQL.Abstract.IndexedRepositoryBase3[T,TKey,TIndex].FindByKey (TKey key) [0x00012] in :0
at Mobile.Infrastructure.Persistence.NoSQL.TasksRepository.Add (Mobile.Entity.Tasks.Abstract.TaskDefinition entity, System.Boolean autoflush) [0x00019] in :0
at Mobile.Infrastructure.BackgroundTasks.TaskManager.RegisterStoreAndForward (Mobile.Entity.Tasks.Abstract.TaskDefinition task) [0x000d0] in :0 {"TaskType":18,"ProNumber":"","TaskId":"51669153-3476-4932-85b2-0aaa9efc229b","RegisteredDate":"2019-12-18T13:28:57.744949-05:00","Completed":false,"ExecutionDate":"2019-12-18T13:28:57.745142-05:00","StatusCode":0,"ExternalMoveId":null,"CurrentEvent":0,"User":"10302t","Password":"","Latitude":10.816047,"Longitude":79.464586,"Accuracy":"5.098404","LocationProvider":"gps","FormattedDate":"20191218 13:28:47","Timezone":"EST","ActivityName":"GEOLOCATION","ExecutionTimes":1,"Message":null,"ResultCode":0,"ActivityCode":"SDGL","Details":null,"Version":""}
I am using the IndexedValue as below
public class TaskIndex : IndexDefinition
{
public IndexedValue<TaskDefinition, bool> Completed { get; set; }
}
Please help. Any insight to this issue is appreciated.
Thanks
Hi,
I am using latest version of MarcelloDB - 1.0.8 and getting an exception (intermittently) on following scenarios -
public IEnumerable FindAll(Func<T, bool> predicate)
{
lock (_lockSessionAccess)
{
return GetCollection().All.Where(predicate);
}
}
public virtual void Add(T entity, bool autoflush = true)
{
lock (_lockSessionAccess)
{
GetCollection().Persist(entity);
if (autoflush) Flush();
}
}
Exception Stack Trace -
Exception:System.InvalidOperationException: Cannot read Int64 as Bool
at MarcelloDB.Serialization.BinaryFormatter.ReadValidTypeID (MarcelloDB.Serialization.BinaryFormatter+TypeID wantedTypeID) [0x0003b] in :0
at MarcelloDB.Serialization.BinaryFormatter.ReadBool () [0x00001] in :0
at MarcelloDB.Serialization.ValueSerializers.BooleanSerializer.ReadValue (MarcelloDB.Serialization.BinaryFormatter formatter) [0x00001] in :0
at MarcelloDB.Serialization.BTreeNodeBinaryFormatterSerializer
1[TKey].ReadEntry (MarcelloDB.Serialization.BinaryFormatter formatter) [0x0001b] in <ce43c20e305646cf958407e87464f571>:0 at MarcelloDB.Serialization.BTreeNodeBinaryFormatterSerializer1[TKey].ReadEntries (MarcelloDB.Serialization.BinaryFormatter formatter) [0x00013] in :0at MarcelloDB.Serialization.BTreeNodeBinaryFormatterSerializer
1[TKey].Deserialize (System.Byte[] bytes) [0x00023] in <ce43c20e305646cf958407e87464f571>:0 at MarcelloDB.Index.BTree.RecordBTreeDataProvider1[TNodeKey].GetNode (System.Int64 address) [0x0003a] in :0at MarcelloDB.Index.BTree.RecordBTreeDataProvider
1[TNodeKey].GetRootNode (System.Int32 degree) [0x00040] in <ce43c20e305646cf958407e87464f571>:0 at MarcelloDB.Index.BTree.BTreeWalker1[TK].Reset () [0x00022] in :0at MarcelloDB.Index.BTree.BTreeWalker
1[TK]..ctor (System.Int32 degree, MarcelloDB.Index.BTree.IBTreeDataProvider1[TK] dataProvider) [0x00024] in :0at MarcelloDB.Index.RecordIndex
1[TNodeKey].GetWalker () [0x00008] in <ce43c20e305646cf958407e87464f571>:0 at MarcelloDB.Collections.BaseIndexedValue2[TObj,TAttribute].EnsureIndex () [0x00045] in :0at MarcelloDB.Collections.Collection
2[T,TID].Initialize () [0x0001e] in <ce43c20e305646cf958407e87464f571>:0 at MarcelloDB.Collections.CollectionFile.Collection[T,TID,TIndexDef] (System.String collectionName, System.Func2[T,TResult] idFunc) [0x0005a] in :0at TXX.Xamarin.Forms.Persistence.NoSQL.Abstract.IndexedRepositoryBase
3[T,TKey,TIndex].GetCollection () [0x00012] in <ba352e7d3b8c4296ac040d6fc327dc5c>:0 at TXX.Xamarin.Forms.Persistence.NoSQL.Abstract.IndexedRepositoryBase3[T,TKey,TIndex].FindByKey (TKey key) [0x00012] in :0at Mobile.Infrastructure.Persistence.NoSQL.TasksRepository.Add (Mobile.Entity.Tasks.Abstract.TaskDefinition entity, System.Boolean autoflush) [0x00019] in :0
at Mobile.Infrastructure.BackgroundTasks.TaskManager.RegisterStoreAndForward (Mobile.Entity.Tasks.Abstract.TaskDefinition task) [0x000d0] in :0 {"TaskType":18,"ProNumber":"","TaskId":"51669153-3476-4932-85b2-0aaa9efc229b","RegisteredDate":"2019-12-18T13:28:57.744949-05:00","Completed":false,"ExecutionDate":"2019-12-18T13:28:57.745142-05:00","StatusCode":0,"ExternalMoveId":null,"CurrentEvent":0,"User":"10302t","Password":"","Latitude":10.816047,"Longitude":79.464586,"Accuracy":"5.098404","LocationProvider":"gps","FormattedDate":"20191218 13:28:47","Timezone":"EST","ActivityName":"GEOLOCATION","ExecutionTimes":1,"Message":null,"ResultCode":0,"ActivityCode":"SDGL","Details":null,"Version":""}
I am using the IndexedValue as below
public class TaskIndex : IndexDefinition
{
public IndexedValue<TaskDefinition, bool> Completed { get; set; }
}
Please help. Any insight to this issue is appreciated.
Thanks