rem: BMSVC.transactionManager.doTransaction(transaction); 
add: if (aSelection.length > 1) gBkmkTxnSvc.endBatch(); if (aSelection.length > this.BATCH_LIMIT && aAction != "move") BMDS.endUpdateBatch(); 
context:   insertSelection: function (aAction, aSelection, aTarget, aTargetIndex)  {    var transaction    = new BookmarkInsertTransaction(aAction);    transaction.item   = new Array(aSelection.length);    transaction.parent = new Array(aSelection.length);    transaction.index  = new Array(aSelection.length);    transaction.removedProp = new Array(aSelection.length);    var index = aTarget.index;    for (var i=0; i<aSelection.length; ++i) {      var rSource = aSelection.item[i];      if (BMSVC.isBookmarkedResource(rSource))        rSource = BMSVC.cloneResource(rSource);      transaction.item  [i] = rSource;      transaction.parent[i] = aTarget.parent;      // we only have aSelection.prop if insertSelection call by paste action we don't use it for move      transaction.removedProp[i] = aSelection.prop ? aSelection.prop[i] : null;      // Broken Insert Code attempts to always insert items in the      // right place (i.e. after the selected item).  However, because      // of RDF Container suckyness, this code gets very confused, due      // to rdf container indexes not matching up to number of items,      // and because we can't trust GetCount to return a real count.      // The -1 is there to handle inserting into the persontal toolbar      // folder via right-click on the PTF.      if (aTarget.index == -1) {        transaction.index[i] = -1;      } else {#ifdef BROKEN_INSERT_CODE        if (aTargetIndex == -1)          transaction.index [i] = (++index);        else          transaction.index [i] = (index++);#else      transaction.index [i] = index++;#endif      }    }    BMSVC.transactionManager.doTransaction(transaction);  },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/b63d39c4e1a2a46f8806477e84548ce028e9554a/bookmarks.js/clean/browser/components/bookmarks/content/bookmarks.js