// Commit POST /{db}/_bulk_docs
556628
func (b *BulkDocument) Commit() ([]BulkDocumentResult, error) {
	if !b.closed {
		b.closed = true
		url, err := buildUrl(b.db.dbName, "_bulk_docs")
		if err != nil {
			return nil, err
		}
		var headers = make(map[string]string)
		headers["Content-Type"] = "application/json"
		headers["Accept"] = "application/json"
		bd := make(map[string]interface{})
		bd["docs"] = b.docs
		data, numBytes, err := encodeData(bd)
		if err != nil {
			return nil, err
		}
		headers["Content-Length"] = strconv.Itoa(numBytes)
		//Yes, this needs to be here.
		//Yes, I know the Golang http.Client doesn't support expect/continue
		//This is here to work around a bug in CouchDB.  It shouldn't work, and yet it does.
		//See: http://stackoverflow.com/questions/30541591/large-put-requests-from-go-to-couchdb
		//Also, I filed a bug report: https://issues.apache.org/jira/browse/COUCHDB-2704
		//Go net/http needs to support the HTTP/1.1 spec, or CouchDB needs to get fixed.
		//If either of those happens in the future, I can revisit this.
		//Unless I forget, which I'm sure I will.
		if numBytes > 4000 {
			headers["Expect"] = "100-continue"
		}
		resp, err := b.db.connection.request("POST", url, data, headers, b.db.auth)
		if err != nil {
			return nil, err
		}
		defer resp.Body.Close()
		return getBulkDocumentResult(resp)
	}
	return nil, fmt.Errorf("CouchDB: Bulk Document has already been executed")
}
153631
func commitUpdates(db *couchdb.CouchDatabase, batchUpdateMap map[string]*batchableDocument) error {
	//Add the documents to the batch update array
	batchUpdateDocs := []*couchdb.CouchDoc{}
	for _, updateDocument := range batchUpdateMap {
		batchUpdateDocument := updateDocument
		batchUpdateDocs = append(batchUpdateDocs, &batchUpdateDocument.CouchDoc)
	}

	// Do the bulk update into couchdb. Note that this will do retries if the entire bulk update fails or times out
	batchUpdateResp, err := db.BatchUpdateDocuments(batchUpdateDocs)
	if err != nil {
		return err
	}
	// IF INDIVIDUAL DOCUMENTS IN THE BULK UPDATE DID NOT SUCCEED, TRY THEM INDIVIDUALLY
	// iterate through the response from CouchDB by document
	for _, respDoc := range batchUpdateResp {
		// If the document returned an error, retry the individual document
		if respDoc.Ok != true {
			batchUpdateDocument := batchUpdateMap[respDoc.ID]
			var err error
			//Remove the "_rev" from the JSON before saving
			//this will allow the CouchDB retry logic to retry revisions without encountering
			//a mismatch between the "If-Match" and the "_rev" tag in the JSON
			if batchUpdateDocument.CouchDoc.JSONValue != nil {
				err = removeJSONRevision(&batchUpdateDocument.CouchDoc.JSONValue)
				if err != nil {
					return err
				}
			}
			// Check to see if the document was added to the batch as a delete type document
			if batchUpdateDocument.Deleted {
				logger.Warningf("CouchDB batch document delete encountered an problem. Retrying delete for document ID:%s", respDoc.ID)
				// If this is a deleted document, then retry the delete
				// If the delete fails due to a document not being found (404 error),
				// the document has already been deleted and the DeleteDoc will not return an error
				err = db.DeleteDoc(respDoc.ID, "")
			} else {
				logger.Warningf("CouchDB batch document update encountered an problem. Retrying update for document ID:%s", respDoc.ID)
				// Save the individual document to couchdb
				// Note that this will do retries as needed
				_, err = db.SaveDoc(respDoc.ID, "", &batchUpdateDocument.CouchDoc)
			}

			// If the single document update or delete returns an error, then throw the error
			if err != nil {
				errorString := fmt.Sprintf("error saving document ID: %v. Error: %s,  Reason: %s",
					respDoc.ID, respDoc.Error, respDoc.Reason)

				logger.Errorf(errorString)
				return errors.WithMessage(err, errorString)
			}
		}
	}
	return nil
}
1223283
func (tx *protoTxn) Commit(ctx context.Context) error {
	if tx.err != nil {
		return tx.err
	}
	return tx.txn.Commit(ctx)
}
583013
func (g *GormTransaction) Commit() error {
	err := g.db.Commit().Error
	g.db = nil
	return errors.WithStack(err)
}
670000
func (tx *Tx) Commit() error {
	err := tx.Tx.Commit()
	if err != nil {
		return tx.EventErr("dbr.commit.error", err)
	}
	tx.Event("dbr.commit")
	return nil
}
767818
func (b *Batch) Flush() (err error) {
	if b.Size() == 0 {
		return nil
	}

	buf, err := b.Bytes()
	if err != nil {
		return err
	}

	b.Docs = nil

	return b.Elastic.Bulk(buf)
}
1232290
func (d *LogBatch) Commit() (err error) {
	log.Printf("%s: BatchCommit\n", d.Name)
	return d.child.Commit()
}
555139
func (te *TxEngine) Commit(ctx context.Context, transactionID int64, mc messageCommitter) (string, error) {
	span, ctx := trace.NewSpan(ctx, "TxEngine.Commit")
	defer span.Finish()
	return te.txPool.Commit(ctx, transactionID, mc)
}
634071
func (s *Sync) commit(req *request) (err error) {
	// Write the node content to the membatch
	s.membatch.batch[req.hash] = req.data
	s.membatch.order = append(s.membatch.order, req.hash)

	delete(s.requests, req.hash)

	// Check all parents for completion
	for _, parent := range req.parents {
		parent.deps--
		if parent.deps == 0 {
			if err := s.commit(parent); err != nil {
				return err
			}
		}
	}
	return nil
}
106129
func (txn *Txn) Commit() error {
	if txn.managed {
		panic("managed transaction cannot be committed directly")
	}

	runtime.SetFinalizer(txn, nil)
	return txn.commit()
}
373499
func (b *BulkDocument) Save(doc interface{}, id, rev string) error {
	if id == "" {
		return fmt.Errorf("No ID specified")
	}
	b.docs = append(b.docs, bulkDoc{id, rev, false, doc})
	return nil
}
184675
func (b *FailBatch) Commit() error {
	if err := b.dstore.errfunc("batch-commit"); err != nil {
		return err
	}

	return b.cb.Commit()
}
610078
func (c *Client) Commit(topic string, partition int32, offset int64) error {
	request := &clientRequest{
		Key: RequestKeyCommit,
		Data: &topicPartitionOffset{
			Topic:     topic,
			Partition: partition,
			Offset:    offset,
		},
	}

	return c.handleRequest(request, nil)
}
235924
func (t *boltTx) Commit() error {
	if t.closed {
		return errors.New("Transaction already closed")
	}
	if t.conn.statement != nil {
		if err := t.conn.statement.Close(); err != nil {
			return errors.Wrap(err, "An error occurred closing open rows in transaction Commit")
		}
	}

	successInt, pullInt, err := t.conn.sendRunPullAllConsumeSingle("COMMIT", nil)
	if err != nil {
		return errors.Wrap(err, "An error occurred committing transaction")
	}

	success, ok := successInt.(messages.SuccessMessage)
	if !ok {
		return errors.New("Unrecognized response type committing transaction: %#v", success)
	}

	log.Infof("Got success message committing transaction: %#v", success)

	pull, ok := pullInt.(messages.SuccessMessage)
	if !ok {
		return errors.New("Unrecognized response type pulling transaction:  %#v", pull)
	}

	log.Infof("Got success message pulling transaction: %#v", pull)

	t.conn.transaction = nil
	t.closed = true
	return err
}
1121722
func (tx *bytesTxn) Commit(ctx context.Context) error {
	_, err := tx.kv.Txn(ctx).Then(tx.ops...).Commit()
	return err
}
1300628
func (tx *OCI8Tx) Commit() error {
	tx.conn.inTransaction = false
	if rv := C.OCITransCommit(
		tx.conn.svc,
		tx.conn.errHandle,
		0,
	); rv != C.OCI_SUCCESS {
		return tx.conn.getError(rv)
	}
	return nil
}
540361
func (obj *Doc) CommitDraft(ctx context.Context, id string) error {
	err := obj.rpc(ctx, "CommitDraft", nil, id)
	return err 
}