This repository was archived by the owner on Mar 11, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +28
-4
lines changed
Expand file tree Collapse file tree 4 files changed +28
-4
lines changed Original file line number Diff line number Diff line change 1414
1515Pod ::Spec . new do |s |
1616 s . name = "CDTDatastore"
17- s . version = "2.0.3 "
17+ s . version = "2.1.0 "
1818 s . summary = "CDTDatastore is a document datastore which syncs."
1919 s . description = <<-DESC
2020 CDTDatastore is a JSON document datastore which speaks the
Original file line number Diff line number Diff line change 1- #define CLOUDANT_SYNC_VERSION "2.0.4-SNAPSHOT "
1+ #define CLOUDANT_SYNC_VERSION "2.1.0 "
Original file line number Diff line number Diff line change 11# CDTDatastore CHANGELOG
22
3- ## Unreleased
3+ ## 2.1.0 (2018-07-10)
44- [ NEW] Add method ` -closeDatastoreNamed: ` on ` CDTDatastoreManager ` .
55- [ FIXED] Fix issue where repeated calls to ` -datastoreNamed:error: ` on ` CDTDatastoreManager ` for
66 the same datastore could cause crashes or failures.
Original file line number Diff line number Diff line change @@ -68,9 +68,33 @@ let ds2 = try manager.datastoreNamed("other_datastore")
6868
6969These datastores are persisted to disk between application runs.
7070
71- The ` CDTDatabaseManager ` handles creating and initialising non-existent
71+ The ` CDTDatastoreManager ` handles creating and initialising non-existent
7272datastores, so the object returned is ready for reading and writing.
7373
74+ Calling ` datastoreNamed ` on an already open datastore will return the same reference to that
75+ datastore.
76+
77+ Datastores are held open for as long as they are needed and are automatically closed when the
78+ ` CDTDatastoreManager ` is deallocated. This will typically happen at the end of the program or
79+ earlier (for instance if ` autoreleasepool ` s are used or the manager is explicitly set to ` nil ` ).
80+
81+ In applications which open large numbers of Datastores it may be necessary to explicitly close
82+ datastores after use to avoid exhaustion of file handles and other native resources.
83+
84+ To close a datastore:
85+
86+ Objective-C:
87+
88+ ``` objc
89+ [manager closeDatastoreNamed: @"my_datastore"] ;
90+ ```
91+
92+ Swift:
93+
94+ ```swift
95+ manager.closeDatastoreNamed("my_datastore");
96+ ```
97+
7498To delete a datastore and all associated data (i.e., attachments and
7599extension data such as indexes (see [ query.md] ( query.md ) ):
76100
You can’t perform that action at this time.
0 commit comments