Re: question on set_action and set_commit

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 18 May 2010 18:56, Kathy McLeod <[email protected]> wrote:
> We are saving some of our "set" values in a database or possibly a flat
> file.  Based on the mib2c stubs generated for scalars, my initial
> interpretation was that the SET_ACTION should write the value(s) to the DB:
>
> case MODE_SET_ACTION:
>            /* XXX: perform the value change here */
>
> but "commit" also seems like a likely place, even tho the stub code does
> not indicate this:
>
> case MODE_SET_COMMIT:
>            /* XXX: delete temporary storage */
>
> In one case, the UNDO would have to reset values in the DB and in the other
> it would not, so my question is, which is the correct place?


Either would be fine.
There is no definitive  One Right Place  to handle this.

The main question arises over how to handle errors.

If you make the changes during the ACTION phase,
then you must be ready to reset the values during the UNDO phase
and be pretty darned sure you can do this successfully.

If you make the changes during the COMMIT phase,
then you must be pretty darned sure that you can assign the
new values successfully.


Only you can make the judgement over which is the more
reliable step in your particular scenario.

Dave

------------------------------------------------------------------------------

_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.