SaveDocument redoRecorder = new SaveDocument(mId, null, 0);
SaveDocument redoRecorder = new SaveDocument(mId, null, 0, folderId);
    public synchronized Document createDocument(OperationContext octxt,     											int folderId,     											String filename,     											String mimeType,     											byte[] rawData,    											MailItem parent) throws ServiceException {       	Document doc;        boolean success = false;       	StoreManager sm = StoreManager.getInstance();       	Blob blob = null;        try {            SaveDocument redoRecorder = new SaveDocument(mId, null, 0);            beginTransaction("createDoc", octxt, redoRecorder);        	int itemId = getNextItemId(ID_AUTO_INCREMENT);           	short volumeId = Volume.getCurrentMessageVolume().getId();           	// TODO: digest, recording upload file info, indexing           	blob = sm.storeIncoming(rawData, null, null, volumeId);            markOtherItemDirty(blob);    		UnderlyingData data = new UnderlyingData();            data.id         = itemId;            data.folderId   = folderId;            data.indexId    = itemId;            data.volumeId   = volumeId;            data.flags      = 0;            data.date       = getOperationTimestamp();            data.size       = rawData.length;            //data.blobDigest = null;        	doc = Document.create(itemId, getFolderById(folderId), volumeId, filename, mimeType, rawData.length, parent);            mCurrentChange.setIndexedItem(doc, null);            sm.link(blob, this, itemId, doc.getSavedSequence(), volumeId);                        success = true;        } catch (IOException ioe) {            throw MailServiceException.MESSAGE_PARSE_ERROR(ioe);        } finally {        	endTransaction(success);            if (blob != null)            	try {            		sm.delete(blob);            	} catch (IOException ioe) {            		// no harm done            	}        }    	return doc;    }