> So, are you saying I should re-initialize the Manager class each time
> and pass it the physical connection I wish to use?
Create your own abstract connection that manager several of them, and
use it as the only neko.db.Manager.cnx.
For example (not tested but that's the idea) :
class MyConnection implements neko.db.Connection {
var cnxMain : neko.db.Connection;
var cnxSub : neko.db.Connection;
var cur : neko.vm.Thread;
var lock : neko.vm.Lock;
public function new( file ) {
cnxMain = neko.db.Sqlite.connect(file);
cnxSub = neko.db.Sqlite.connect(file);
main = neko.vm.Thread.current();
lock = new neko.vm.Lock();
lock.release();
}
public function request( sql ) {
if( neko.vm.Thread.current() == main )
return cnxMain.request(sql);
lock.lock();
var r = cnxSub.request(sql);
lock.release();
return r;
}
...
}
Nicolas
--
Neko : One VM to run them all
(http://nekovm.org)