[Mono-dev] New Mono.Data.Sqlite problems with UTF8 conversion on Windows

Kamil Skalski kamil.skalski at gmail.com
Sat Jun 2 12:27:30 EDT 2007


Hello!

I was trying to use the new implementation of Sqlite provider
available now on mono, but I had  several problems with it...
First of all it failed to perform BindParameters properly when I tried
to use named parameters. After some debugging it appeared that the
names of parameters are improperly read from data returned by sqlite
native function. The problem was the usage of
Marshal.PtrToStrAuto   in SQLiteConvert.cs
function, which didn't properly decode strings on Windows system.
I patched the implementation with the way it is done in old
Mono.Data.SqliteClient - the implementation isn't very elegant, since
it adds usage of unsafe pointer, but it worked well in the old
implementation. If anybody knows a better way to convert unmanaged
utf8 strings into managed string, without adding dependency on other
libraries, then we could do this better.

The second problem I encounter with new implementation is that it
seems to deadlock when there are two threads using the same
data-base... I use separate connections for each thread, but it looks
like when I perform data-modify operations from both, it locks totally
(concurrent reads seems to be ok). If anyone has some suggestions,
please let me know. For now I will stick with old implementation.

-- 
Kamil Skalski
http://nazgul.omega.pl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sqlite_utf.diff
Type: application/octet-stream
Size: 1710 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-devel-list/attachments/20070602/b7bf1930/attachment.obj 


More information about the Mono-devel-list mailing list