FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Fedora Directory

 
 
LinkBack Thread Tools
 
Old 06-23-2008, 09:02 PM
Eric
 
Default Use of SLAPI_PLUGIN_BE_POST_MODIFY_FN

I would like to perform an action if and only if a database operation succeeds, as well as revert that database operation if the action fails. From the documentation I understand I should wrap both in a transaction and implement it through these parameters: SLAPI_PLUGIN_BE_POST_MODIFY_FN, SLAPI_PLUGIN_BE_POST_ADD_FN, SLAPI_PLUGIN_BE_POST_DELETE_FN.

However I'm not sure how to write that transaction. Is there a code sample? How should I configure the plugin -- nsslapd-plugintype: postperation doesn't seem to be the right type...


--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 
Old 06-23-2008, 09:21 PM
Rich Megginson
 
Default Use of SLAPI_PLUGIN_BE_POST_MODIFY_FN

Eric wrote:

I would like to perform an action if and only if a database operation succeeds,

You can do this.

as well as revert that database operation if the action fails.

You can't do this. That is, you can't revert another prior operation.

From the documentation I understand I should wrap both in a transaction and implement it through these parameters: SLAPI_PLUGIN_BE_POST_MODIFY_FN, SLAPI_PLUGIN_BE_POST_ADD_FN, SLAPI_PLUGIN_BE_POST_DELETE_FN.

It might be possible, but you'd have to hack the database code in order
to get all of your operations into a single database transaction. BE
plugins are called inside the database lock, so you can be assured that
your code will be called with the database in a consistent state, but
you can't use them to add other operations to the transaction.

However I'm not sure how to write that transaction. Is there a code sample? How should I configure the plugin -- nsslapd-plugintype: postperation doesn't seem to be the right type...


--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users



--
Fedora-directory-users mailing list
Fedora-directory-users@redhat.com
https://www.redhat.com/mailman/listinfo/fedora-directory-users
 

Thread Tools




All times are GMT. The time now is 09:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org