public static void sudoSave ( final ODocumentWrapper ... dws ) { if ( dws == null || dws . length == 0 ) return ; new DBClosure < Boolean > ( ) { @ Override protected Boolean execute ( ODatabaseDocument db ) { db . begin ( ) ; for ( ODocumentWrapper dw : dws ) { dw . save ( ) ; } db . commit ( ) ; return true ; } } . execute ( ) ; }
Allow to save set of document wrappers under admin