[fpc-devel] sqlite support for Android

michael.vancanneyt at wisa.be michael.vancanneyt at wisa.be
Tue Apr 3 14:50:35 CEST 2012

On Tue, 3 Apr 2012, Felipe Monteiro de Carvalho wrote:

> On Tue, Apr 3, 2012 at 11:47 AM, Jonas Maebe <jonas.maebe at elis.ugent.be> wrote:
>>> In Android a dlopen operation without a full path will fail:
>> A bit of googling suggests that the above statement is wrong:
>> http://groups.google.com/group/android-ndk/browse_thread/thread/2779732b85fef9b3#f0cb99298fa286e1
> ops, it seams you are correct. In a new test sending only sqlite.so
> worked properly ... no idea why the first test failed. Probably I was
> using an old APK or library which tested against libsqlite3.so which
> fails.
> Continuing I have an even much wierder issue. The following code:
> procedure TForm3.Button2Click(Sender : TObject) ;
> begin
>  SQLite3Connection1.ExecuteDirect('CREATE TABLE IF NOT EXISTS PRODUTOS ( '+
>     'DESCRICAO VARCHAR(50), '+
>     'PRECO NUMERIC(12,3), '+
> end;
> Causes a very wierd crash without stacktrace and no way to work
> around, but only in LCL-CustomDrawn it works fine in LCL-Gtk2:
> (gdb) break fpc_raiseexception
> Breakpoint 1 at 0x8058d46
> (gdb) cont
> Continuing.
> MouseMove x=47 y=93
> MouseMove x=-9 y=63
> MouseMove x=-79 y=47
> MouseMove x=-57 y=58
> MouseMove x=-26 y=63
> [Thread debugging using libthread_db enabled]
> Cannot find new threads: generic error
> Missing debug package(s), you should install: sqlite3-debug-3.7.9-1.1.mga1.i586
> (gdb) bt
> Target is executing.
> This package does not exist. And if I add "cthreads" as the first unit
> in the project automagically it starts working o.O It looks really
> wierd that sqlite is using threading behind my back, or is it sqldb?

SQLDb does not use threads by itself.

It can be that the sqlite library uses threads, and if a SQLite callback 
is done from a different thread, then the RTL may present you with a nice error.


More information about the fpc-devel mailing list