Hello,

I would like to minimize the  overhead of my DBRMS by using memcached. I
found this class which is out-to-date unfortunately:

http://www.zachary.com/s/blog/2005/09/18/sqlobject_and_memcached,_part_1

However i have the following error:

In [1]: import model; model.User(email='[EMAIL PROTECTED]', name='Arnaud 
Fontaine', password='foo', activeKey=None)
---------------------------------------------------------------------------
/usr/lib/python2.4/site-packages/sqlobject/declarative.py in
_wrapper(self, *args, **kwargs)
     91         def _wrapper(self, *args, **kwargs):
     92             lock.acquire()
---> 93             return_value = fn(self, *args, **kwargs)
     94             lock.release()
     95             return return_value

/usr/lib/python2.4/site-packages/sqlobject/main.py in __init__(self,
**kw)
   1212             id = None
   1213 
-> 1214         self._create(id, **kw)
   1215         for func in post_funcs:
   1216             func(self)

/usr/lib/python2.4/site-packages/sqlobject/main.py in _create(self, id,
**kw)
   1237                 kw[column.name] = default
   1238 
-> 1239         self.set(**kw)
   1240 
   1241         # Then we finalize the process:

/src/work/soc/mainline/src/wotomae/so_memcached.py in set(self, **kw)
     68     def set(self, **kw):
     69         try:
---> 70             self._use()
     71         except UnfreshObject:
     72             self._use()

/src/work/soc/mainline/src/wotomae/so_memcached.py in _use(self)
     32             self._serial = 0
     33 
---> 34         k = self._key()
     35         s = mc.get( k )
     36         if s:

/src/work/soc/mainline/src/wotomae/so_memcached.py in _key(self)
     24 class SharedObject( sqlobject.SQLObject ):
     25     def _key( self ):
---> 26         return self.__class__.__name__ + str(self.id)
     27 
     28     def _use( self ):

/src/work/soc/mainline/src/wotomae/so_memcached.py in
__getattribute__(self, name)
     64         if name in ['name','val']:
     65             self._use()
---> 66         return sqlobject.SQLObject.__getattribute__( self, name)
     67 
     68     def set(self, **kw):

AttributeError: 'User' object has no attribute 'id'

I find  how to fix  that but no  solution was really great.  The problem
seems to come  from using class.id instead of class.q.id.  Any idea ? In
the future,  is this kind  of work could  be integrated in  the official
source ?

Is there another solutions for doing requests cache ?

Regards,
Arnaud Fontaine

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss

Reply via email to