Okay, here's a question for you. I'm using SPOD, so both threads
initialize the neko.db.Manager class and pass the db connection
statically to that class. If all threads used by a single vm share the
same memory, then technically, use of the static features of Manager
would use the same data. Am I right? If so, then how do I split this
per thread?
Thanks,
Lee
Nicolas Cannasse wrote:
Hi list,
I'm currently developing an app using Neko that uses a thread as a timer
mechanism, which when fired, performs an update from a remote location.
This update includes adding data to a local Sqlite database. The
problem is, if the current thread happens to try accessing the db when
the updater thread accesses it, I get a "library routine called out of
sequence" error... At least, this is what I'm assuming is happening. I
always thought Sqlite db's were locked by the Sqlite engine when it is
accessed in order to prevent conflicts. Is there a way to avoid this
with the haXe api?
a) first check that use two different sqllite connections (one per thread)
b) create a global lock ( new neko.vm.Lock() in haXe API ) and release
it. then before each sqlite request, lock. Then unlock when done.
Nicolas
--
Neko : One VM to run them all
(http://nekovm.org)