Hi Niphlod,

Since the usecase for a Scheduler often needs concurrent fast write/reads 
and updates (from multiple clients) with information that is largely 
temporary I think a Nosql DB is a great way to handle scheduler data.

In my case I don't want the overhead of installing a full relational db and 
I'm sure that the SQLite adapter will not perform well under load with 
multiple scheduler tasks.

Since I posted I have tried CouchDB as my Auth db and am getting similar 
errors (at the same code point as above) about the encoding. I am using 
Python 2.6, web2py Version 2.00.0 (2012-07-18 21:46:56) dev and CouchDB 
1.0.1.

Ted
 

On Thursday, July 26, 2012 2:07:17 AM UTC+7, Niphlod wrote:
>
> Scheduler was meant to run on relational dbs. Actually, I think noone ever 
> tested it on Nosql adapters, but if this is a popular requirement I could 
> see into it.
>
> BTW, I posted an app to test the scheduler in trunk for this kind of tests.
>
> https://groups.google.com/d/topic/web2py/E_mASrZIpvw/discussion
>
>
>
> On Wednesday, July 25, 2012 1:42:50 PM UTC+2, Ted wrote:
>>
>> Hi Web2pyers,
>>
>> Has anyone sucessfully used the new scheduler functionality with *
>> CouchDB? *(I'm assuming this is feasible)
>>
>> I'm currently trying to use the scheduler on *Windows 7* with *CouchDB *as 
>> the DAL source.
>> My code works fine with sqlite but seems to silently fail using *CouchDB*- 
>> although the tables are correctly created.
>>
>> e.g.
>>
>> scheduler_db = DAL('couchdb://127.0.0.1:5984')
>> scheduler = 
>> Scheduler(scheduler_db,dict(demo1=demo1,demo2=demo2),heartbeat=1) 
>>
>>
>> (The *CouchDB* scheduler_worker table seems to mysteriously keep 
>> growing.)
>>
>> When I try to manually add a task through the Admin (
>> http://127.0.0.1:8000/init/appadmin/insert/scheduler_db/scheduler_task)
>>
>> I get the following error:
>>
>> Traceback (most recent call last):
>>   File "C:\Users\ted\dev\web2py\gluon\restricted.py", line 205, in restricted
>>     exec ccode in environment
>>   File "C:/Users/ted/dev/Px/applications/init/controllers/appadmin.py" 
>> <http://127.0.0.1:8000/admin/default/edit/init/controllers/appadmin.py>, 
>> line 270, in <module>
>>   File "C:\Users\ted\dev\web2py\gluon\globals.py", line 182, in <lambda>
>>     self._caller = lambda f: f()
>>   File "C:/Users/ted/dev/Px/applications/init/controllers/appadmin.py" 
>> <http://127.0.0.1:8000/admin/default/edit/init/controllers/appadmin.py>, 
>> line 103, in insert
>>     if form.accepts(request.vars, session):
>>   File "C:\Users\ted\dev\web2py\gluon\sqlhtml.py", line 1307, in accepts
>>     self.vars.id = self.table.insert(**fields)
>>   File "C:\Users\ted\dev\web2py\gluon\dal.py", line 7422, in insert
>>     ret =  self._db._adapter.insert(self,self._listify(fields))
>>   File "C:\Users\ted\dev\web2py\gluon\dal.py", line 4432, in insert
>>     values = dict((k.name,self.represent(v,k.type)) for k,v in fields)
>>   File "C:\Users\ted\dev\web2py\gluon\dal.py", line 4432, in <genexpr>
>>     values = dict((k.name,self.represent(v,k.type)) for k,v in fields)
>>   File "C:\Users\ted\dev\web2py\gluon\dal.py", line 4402, in represent
>>     return repr(not isinstance(value,unicode) and value or 
>> value.encode('utf8'))
>> AttributeError: 'long' object has no attribute 'encode'
>>
>> Any suggestions on what is going wrong?
>>
>> Thanks,
>> Ted
>>
>>
>>

-- 



Reply via email to