[Mono-bugs] [Bug 679561] New: Open Sqlite database with SqliteFunction on device returns an error

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Mar 14 18:03:19 EDT 2011


https://bugzilla.novell.com/show_bug.cgi?id=679561

https://bugzilla.novell.com/show_bug.cgi?id=679561#c0


           Summary: Open Sqlite database with SqliteFunction on device
                    returns an error
    Classification: Mono
           Product: MonoTouch
           Version: unspecified
          Platform: iPad
        OS/Version: Mac OS X 10.6
            Status: NEW
          Severity: Critical
          Priority: P5 - None
         Component: Runtime
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: karl at e-magesolutions.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Development
           Blocker: ---


Description of Problem:
When in project exists a SqliteFunction created, on emulator all runs OK, but
on device  it returns an error when it tries do open a connection to database.

Steps to reproduce the problem:
1. Make a class to create a function:
[SqliteFunction(Name = "GETDATE", Arguments = 0, FuncType =
FunctionType.Scalar)]
class GETDATE : SqliteFunction
{
    public override object Invoke(object[] args)
    {
        return DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
    }
}


2. Open a connection to the sqlite database:
using (SqliteConnection sqlConnection = new SqliteConnection())
{
  sqlConnection.ConnectionString = "Data Source=DBFilName_on_Documents_Folder";
  sqlConnection.Open();
  // etc
}

Actual Results:
On sqlConnection.Open() an error occurs:

Mon Mar 14 18:34:42 iPad-de-Karl
UIKitApplication:com.cedat.visilab[0x6ae3][6739] <Notice>: Unhandled Exception:
System.ExecutionEngineException: Attempting to JIT compile method '(wrapper
native-to-managed) Mono.Data.Sqlite.SqliteFunction:ScalarCallback
(intptr,int,intptr)' while running with --aot-only.

Mon Mar 14 18:34:42 iPad-de-Karl
UIKitApplication:com.cedat.visilab[0x6ae3][6739] <Notice>:   at (wrapper
managed-to-native) Mono.Data.Sqlite.UnsafeNativeMethods:sqlite3_create_function
(intptr,byte[],int,int,intptr,Mono.Data.Sqlite.SQLiteCallback,Mono.Data.Sqlite.SQLiteCallback,Mono.Data.Sqlite.SQLiteFinalCallback)


Mon Mar 14 18:34:42 iPad-de-Karl
UIKitApplication:com.cedat.visilab[0x6ae3][6739] <Notice>:   at
Mono.Data.Sqlite.SQLite3.CreateFunction (System.String strFunction, Int32
nArgs, Boolean needCollSeq, Mono.Data.Sqlite.SQLiteCallback func,
Mono.Data.Sqlite.SQLiteCallback funcstep, Mono.Data.Sqlite.SQLiteFinalCallback
funcfinal) [0x00000] in <filename unknown>:0 

Mon Mar 14 18:34:42 iPad-de-Karl
UIKitApplication:com.cedat.visilab[0x6ae3][6739] <Notice>:   at
Mono.Data.Sqlite.SqliteFunction.BindFunctions (Mono.Data.Sqlite.SQLiteBase
sqlbase) [0x00000] in <filename unknown>:0 

Mon Mar 14 18:34:42 iPad-de-Karl
UIKitApplication:com.cedat.visilab[0x6ae3][6739] <Notice>:   at
Mono.Data.Sqlite.SQLite3.Open (System.String strFilename, SQLiteOpenFlagsEnum
flags, Int32 maxPoolSize, Boolean usePool) [0x00000] in <filename unknown>:0 

Expected Results:
Just open the database for manipulation, including executing the new created
function

How often does this happen? 
Always when try to execute on device (iPad). On emulator this don't happens.

Additional Information:
I tried the same with Effiproz 1.5, coincidence or not, on emulator it runs all
the same steps correctly that with sqlite, and on iPad it gives an error. But
with or without functions so maybe not the same problem but was related to
"Attempting to JIT compile method '(wrapper native-to-managed)" too.

-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list