src/main/java/com/billybyte/mongo/MongoXml.java
public void batchInsert(Map<String,T> insertMap, int batchSize) throws MongoException {
		List<DBObject> batchList = new ArrayList<DBObject>();
		for(Entry<String,T> entry:insertMap.entrySet()) {
			BasicDBObject dbo = new BasicDBObject();
			dbo.put(KEY_FIELD, entry.getKey());
			dbo.put(VALUE_FIELD, xs.toXML(entry.getValue()));
			batchList.add(dbo);
			
			if(batchList.size()==batchSize) {
//				try {
//					this.dbColl.insert(batchList);
//				} catch (MongoException e) {
//					Utils.prtObErrMess(this.getClass(), "Batch insert exception, aborting insertion, REASON: "+e.getLocalizedMessage());
//					return;
//				}
				this.dbColl.insert(batchList);
				batchList.clear();
			}
		}
		if(!batchList.isEmpty()) {
			this.dbColl.insert(batchList);
		}
	}
/**
	 * Perform a batch insert on the collection in pieces according to the batch size
	 * @param insertMap
	 */
Perform a batch insert on the collection in pieces according to the batch size
@param insertMap
Perform a batch insert on the collection in pieces according to the batch size @param insertMap
public void batchInsert(Map<String,T> insertMap, int batchSize) throws MongoException {
		List<DBObject> batchList = new ArrayList<DBObject>();
		for(Entry<String,T> entry:insertMap.entrySet()) {
			BasicDBObject dbo = new BasicDBObject();
			dbo.put(KEY_FIELD, entry.getKey());
			dbo.put(VALUE_FIELD, xs.toXML(entry.getValue()));
			batchList.add(dbo);
			if(batchList.size()==batchSize) {
				this.dbColl.insert(batchList);
				batchList.clear();
			}
		}
		if(!batchList.isEmpty()) {
			this.dbColl.insert(batchList);
		}
	}
public void batchInsert ( Map < String , T > insertMap , int batchSize ) throws MongoException { List < DBObject > batchList = new ArrayList < DBObject > ( ) ; for ( Entry < String , T > entry : insertMap . entrySet ( ) ) { BasicDBObject dbo = new BasicDBObject ( ) ; dbo . put ( KEY_FIELD , entry . getKey ( ) ) ; dbo . put ( VALUE_FIELD , xs . toXML ( entry . getValue ( ) ) ) ; batchList . add ( dbo ) ; if ( batchList . size ( ) == batchSize ) { this . dbColl . insert ( batchList ) ; batchList . clear ( ) ; } } if ( ! batchList . isEmpty ( ) ) { this . dbColl . insert ( batchList ) ; } }
Perform a batch insert on the collection in pieces according to the batch size
 @param insertMap
Perform a batch insert on the collection in pieces according to the batch size @param insertMap
//				try { //					this.dbColl.insert(batchList); //				} catch (MongoException e) { //					Utils.prtObErrMess(this.getClass(), "Batch insert exception, aborting insertion, REASON: "+e.getLocalizedMessage()); //					return; //				}