On 9/15/06, Hiroki Tamakoshi <[EMAIL PROTECTED]> wrote: > Thanks Dan, > > Can I consult with you even if the problem I have is not the problem of > circular references? > > The expected work is clear, and natural I think: > 1. A sqlobject is persistent in RDBMS, > 2. and when I want to delete the object, it is freed from memory(and > cache), but its data is still persistent in RDBMS. > > Here is a sample code: > > obj_list = [] > for i in xrange( 1000 ): > obj = SomeObject( parameters ... ) > obj_list.append( obj ) # memory grows > > for obj in obj_list: > obj.expire() # clear cache > > del obj_list[:] > # expected work: clear memory, but data remain in RDBMS. > # actual work: memory doesn't seem to be cleared, data remain in RDBMS.
del obj_list[:] in your example code is definitely not what you want. By [:] you create a copy of your list, and the statement you wrote deletes just this copy. In the following example obj_list is still there. obj_list = [] del obj_list[:] print obj_list You definitely want to del obj_list ------------------------------------------------------------------------- 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 sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss