"too many SQL variables" on UpdateWithChildren

Issue #64 new
김동현 created an issue

Error.PNG Error2.PNG

I have assumed that the OneToMany peoperty which have 1020 items is a problem. How do I solve this problem?

// packages.config <?xml version="1.0" encoding="utf-8"?> <packages> <package id="Newtonsoft.Json" version="6.0.8" targetFramework="net45" /> <package id="SQLite.Net.Platform.Win32" version="2.5.1" targetFramework="net45" /> <package id="SQLite.Net-PCL" version="2.5.1" targetFramework="net45" /> <package id="SQLiteNetExtensions" version="1.2.5" targetFramework="net45" /> <package id="System.Data.SQLite.Core" version="1.0.96.0" targetFramework="net45" /> </packages> //

Comments (13)

  1. Guillermo Gutiérrez

    We found out that there's a 1000 variable count limit in some Windows platforms. We already added a fix for DeleteAll method, it seems that I need to check the UpdateWithChildren method. I'll review it as soon as possible.

  2. Márton Dankó

    I get the same error at InsertOrReplaceWithChildren, I think you need to watch all of these methods.

  3. Guillermo Gutiérrez

    I don't have a windows machine to reproduce the error and it's working fine on Mac and iOS. Can someone check where it's exactly crashing inside the library? Thanks.

  4. Robert Nitsch

    I can confirm this issue. We also encounter the problem when calling UpdateWithChildren.

    This is our stacktrace:

      at SQLite.Net.Platform.XamarinAndroid.SQLiteApiAndroid.Prepare2 (IDbHandle db, System.String query) [0x00037] in <filename unknown>:0 
      at SQLite.Net.SQLiteCommand.Prepare () [0x0001c] in <filename unknown>:0 
      at SQLite.Net.SQLiteCommand.ExecuteNonQuery () [0x00016] in <filename unknown>:0 
      at SQLite.Net.SQLiteConnection.Execute (System.String query, System.Object[] args) [0x00044] in <filename unknown>:0 
      at SQLiteNetExtensions.Extensions.WriteOperations.UpdateOneToManyInverseForeignKey (SQLite.Net.SQLiteConnection conn, System.Object element, System.Reflection.PropertyInfo relationshipProperty) [0x001c6] in <filename unknown>:0 
      at SQLiteNetExtensions.Extensions.WriteOperations.UpdateInverseForeignKeys (SQLite.Net.SQLiteConnection conn, System.Object element) [0x00040] in <filename unknown>:0 
      at SQLiteNetExtensions.Extensions.WriteOperations.UpdateWithChildren (SQLite.Net.SQLiteConnection conn, System.Object element) [0x0000e] in <filename unknown>:0 
      at MyApp.UpdateStuff (Stuff stuff) [0x00008] in D:\bla\bla\StuffContentProvider.cs:267 
    

    This is a very serious bug for us, because in our app it can happen very quickly that a database object references more than 1000 other objects.

  5. Guillermo Gutiérrez

    @rsnitsch thanks for the stack trace. That seems to be fixed in master branch, but a new nuget package hasn't been published since then. Can you check with the latest sources?

  6. Andrew Robinson

    Getting the same issue for InsertWithChildren. Any news on a nuget publish? And will it contain fixes for all methods where this is an issue?

  7. Mohamed Aymen Haddad

    Xamarin.Forms PCL Project Running test iOS version

    Exception returned : System.TypeInitializationException: The type initializer for 'MyapplicationName.App' threw an exception.

    I have Initialized a variable that handles the database in APP.cs

    and the exception is thrown when create table is executed (using breakpoints):

    public DataBase()
            {
                _connectionToDB = DependencyService.Get<ISQLite>().GetConnection();
    **            _connectionToDB.CreateTable<person>();
    **        }
    

    and on the stack trace i got : > 0x13 in MyApplicationAPP.iOS.AppDelegate.FinishedLaunching at ..\MyApplicationAPP\iOS\AppDelegate.cs:24,13 C#

  8. Log in to comment