Deleting all rows in MibTable

Kjersti Grønnevik kgr____morecom.no
Fri Mar 22 15:33:50 CET 2002


Hi
 
Thanks so much for great help!! It works! :-)
 
Regards,
Kjersti

-----Original Message-----
From: Alex Finogenov [mailto:afinogenov____malibunet.com]
Sent: 21. mars 2002 20:13
To: Kjersti Grønnevik; Alex Finogenov
Cc: agentpp-dl____agentpp.com
Subject: RE: Deleting all rows in MibTable


Kjersti,
 
A good question. This code should be called after the completion of each request, or before the start of processing of the next request. Since I am not aware of any public or protected MibTable method except MibTable::update() that can help me to accomplish this, I take care of the cleanup in the overloaded MibTable::update().
 
Since MibTable::update() may be invoked more than once during processing of a request, I implemented a state object that keeps track of a few things, including whether the table is being processed in the same request or in a new one. This is determined using Request::get_request_id(). If it's a new request, the cleanup of the table is called.
 
This is a rather "lazy" approach (i.e. a table is not cleaned up until the next request), so it is important to ensure a proper destruction when the agent is shut down. Your requirements may demand a more proactive approach. If anybody knows of a better way to handle this, I'd like to learn about it.
 
I guess your "main loop" approach could work if you cleanup ALL tables. This could be somewhat wasteful, unless you optimize this by keeping tables' states and trashing only those ones that have been touched in a previous request.
 
Alex

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.agentpp.org/pipermail/agentpp/attachments/20020322/6a86f660/attachment.htm 


More information about the AGENTPP mailing list