diff options
author | Damien F. Katz <damien@apache.org> | 2009-01-05 05:42:52 +0000 |
---|---|---|
committer | Damien F. Katz <damien@apache.org> | 2009-01-05 05:42:52 +0000 |
commit | 10eac24f530b5de1ea30c83518d3971f99890db6 (patch) | |
tree | f5565b0002ec028538c78b65febaddb675297596 /share/www/script/couch.js | |
parent | 4228d249b4216d390aa1f8f063d09527c4dcbe6a (diff) |
Delayed commit patch. Allows documents to be saved immediately but fully committed asynchronously. On by default, to fully commit documents synchronously, use X-Couch-Full-Commit=true in the http header. We still needs to prevent committing view indexes ahead of data and to detect when a server has crashed causing potentially lost updates during remote replication (fixed by retrying the incremental replication).
git-svn-id: https://svn.apache.org/repos/asf/couchdb/trunk@731452 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'share/www/script/couch.js')
-rw-r--r-- | share/www/script/couch.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/share/www/script/couch.js b/share/www/script/couch.js index 505d653f..e1806d6f 100644 --- a/share/www/script/couch.js +++ b/share/www/script/couch.js @@ -108,6 +108,12 @@ function CouchDB(name, httpHeaders) { } return result; } + + this.ensureFullCommit = function() { + this.last_req = this.request("POST", this.uri + "_ensure_full_commit"); + CouchDB.maybeThrowError(this.last_req); + return JSON.parse(this.last_req.responseText); + } // Applies the map function to the contents of database and returns the results. this.query = function(mapFun, reduceFun, options, keys) { |