I'm using OA ver. 2012.1.301.2 in my WCF application. As a database I'm using sqlite.
I have service with InstanceContextMode.PerSession which owns OA model (OA context). I also have percall service (lets call it service2) which save some data in db. Service2 uses model provided by service1. I'm also using spatialite extension to store some geodata in sqlite db so in my case Save changes looks like:
(DbCommand cmd = Connection.StoreConnection.CreateCommand())
cmd.CommandText = @
When I'm trying batch insert lots of data it throws exceptions like NRE, "Telerik.OpenAccess.Exceptions.InvalidOperationException: Not allowed because Commit / Rollback is in progress" and etc.
So, I read this
blog post and decided to use lock;
SaveGeoData<T>(T data) where T :
But when I have more than one sessions which own models I'm steel getting errors, exceptions like above.
I decided to use static lock for all models not for it's instance which ofcourse decreases performance and I got Telerik.OpenAccess.RT.sql.SQLException: The database file is locked.
All these problems I'm expecting when I'n trying to do batch insert, so
calls one thread in percall wcf service.
I tried every possible settings in Isolation level and transaction mode -- nothing helps. Maybe you can advice preferable settings
for working with sqlite with highload, some useful pragmas and etc. Maybe I should recompile sqlite engine with specific options?
Maybe there are some usefull patterns for this case (highload,sqlite)? Also can you explain for what purposes Multithread context option is if it doesn't help?
I can provide you simple multithreaded application with settings that duplicate my main app.
Thank you very,very much in advance.
PS: I'm using 184.108.40.206 client of Sqlite for .net.