/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2004 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
e->e_id = id;
- if( cache_add_entry_rw( &li->li_cache, e, rw ) != 0 ) {
+ if ( slapMode == SLAP_SERVER_MODE
+ && cache_add_entry_rw( &li->li_cache, e, rw ) != 0 )
+ {
entry_free( e );
/* XXX this is a kludge.
rw ? "w" : "r", id, (unsigned long) e );
#endif
- /* marks the entry as committed, so it will get added to the cache
- * when the lock is released */
- cache_entry_commit( e );
+ if ( slapMode == SLAP_SERVER_MODE ) {
+ /* marks the entry as committed, so it will get added to the cache
+ * when the lock is released */
+ cache_entry_commit( e );
+ }
return( e );
}