Good ORM

I have been using SQLite.NET to work with my app's database. However, it has been generating random Object Reference Errors (a few a day) and after the most recent update became unusable due to how slow it became. Does anyone know of a good ORM to use in Android and iOS apps?

Answers

  • TimYocum.2842TimYocum.2842 USUniversity ✭✭

    Do you have logging in your code to see where the Object Errors are coming from? It could be the data access code that is causing these errors, i.e. using linq queries to find data that doesn't exist.

  • RobertWakeland.4316RobertWakeland.4316 USMember, University ✭✭

    Yeah, I get full error reports whenever it happens (assuming the device is connected to the internet). Here is a couple of different examples:

    Example 1: Getting all items stored in the database (app launch)

    at (wrapper managed-to-native) SQLite.Net.Platform.XamarinAndroid.SQLiteApiAndroidInternal:sqlite3_step (intptr) at SQLite.Net.Platform.XamarinAndroid.SQLiteApiAndroid.Step (IDbStatement stmt) [0x00000] in :0 at SQLite.Net.SQLiteCommand+d__01[MyCustomObject].MoveNext () [0x00000] in :0 at System.Collections.Generic.List1[MyCustomObject].AddEnumerable (IEnumerable1 enumerable) [0x00000] in :0 at System.Collections.Generic.List1[MyCustomObject]..ctor (IEnumerable1 collection) [0x00000] in :0 at System.Linq.Enumerable.ToList[MyCustomObject] (IEnumerable1 source) [0x00000] in :0 at SQLite.Net.SQLiteCommand.ExecuteQuery[MyCustomObject] () [0x00000] in :0 at SQLite.Net.TableQuery1[MyCustomObject].GetEnumerator () [0x00000] in :0 at System.Collections.Generic.List1[MyCustomObject].AddEnumerable (IEnumerable1 enumerable) [0x00000] in :0 at System.Collections.Generic.List1[MyCustomObject]..ctor (IEnumerable1 collection) [0x00000] in :0 at System.Linq.Enumerable.ToList[MyCustomObject] (IEnumerable1 source) [0x00000] in :0 at MyNamespace.GetAllCustomObjects () [0x00000] in :0 at MyNamespace.GetMyCustomObjectList () [0x00000] in :0 at MyCustomObjectList+d__12.MoveNext () [0x00000] in :0

    Example 2: Updating an item in the database

    at (wrapper managed-to-native) SQLite.Net.Platform.XamarinAndroid.SQLiteApiAndroidInternal:sqlite3_bind_text16 (intptr,int,string,int,intptr) at SQLite.Net.Platform.XamarinAndroid.SQLiteApiAndroid.BindText16 (IDbStatement stmt, Int32 index, System.String val, Int32 n, IntPtr free) [0x00000] in :0 at SQLite.Net.SQLiteCommand.BindParameter (ISQLiteApi isqLite3Api, IDbStatement stmt, Int32 index, System.Object value, Boolean storeDateTimeAsTicks, IBlobSerializer serializer) [0x00000] in :0 at SQLite.Net.SQLiteCommand.BindAll (IDbStatement stmt) [0x00000] in :0 at SQLite.Net.SQLiteCommand.Prepare () [0x00000] in :0 at SQLite.Net.SQLiteCommand.ExecuteNonQuery () [0x00000] in :0 at SQLite.Net.SQLiteConnection.Execute (System.String query, System.Object[] args) [0x00000] in :0 at SQLite.Net.SQLiteConnection.Update (System.Object obj, System.Type objType) [0x00000] in :0 at SQLite.Net.SQLiteConnection.Update (System.Object obj) [0x00000] in :0 at UpdateMyCustomObject (MyCustomObject myCustomObject) [0x00000] in :0 at MyCustomObjectList+d__12.MoveNext () [0x00000] in :0

Sign In or Register to comment.