diff --git a/json-patch b/json-patch index a2c345b..c73bbd1 160000 --- a/json-patch +++ b/json-patch @@ -1 +1 @@ -Subproject commit a2c345bd1e4af73de0ce86cbf6724e0c0f867ace +Subproject commit c73bbd19b8d2f85d53af1e31f558f90bee966e60 diff --git a/json-ptr b/json-ptr index 9c9b111..33a2af1 160000 --- a/json-ptr +++ b/json-ptr @@ -1 +1 @@ -Subproject commit 9c9b11108ba6b2ef1fd5631a129c42a2f2e8271d +Subproject commit 33a2af147e5266fa97e373e5e412583be1781991 diff --git a/patch-db/src/lib.rs b/patch-db/src/lib.rs index 0a8edb4..fb60ed3 100644 --- a/patch-db/src/lib.rs +++ b/patch-db/src/lib.rs @@ -19,6 +19,7 @@ mod test; pub use handle::{DbHandle, PatchDbHandle}; pub use json_ptr; +pub use json_patch; pub use locker::{LockType, Locker}; pub use model::{ BoxModel, HasModel, Map, MapModel, Model, ModelData, ModelDataMut, OptionModel, VecModel, diff --git a/patch-db/src/transaction.rs b/patch-db/src/transaction.rs index 6b91a36..95a72cd 100644 --- a/patch-db/src/transaction.rs +++ b/patch-db/src/transaction.rs @@ -29,10 +29,13 @@ pub struct Transaction { impl Transaction<&mut PatchDbHandle> { pub async fn commit(mut self, expire_id: Option) -> Result, Error> { let store_lock = self.parent.store(); - let store = store_lock.read().await; + let store = store_lock.write().await; self.rebase()?; - let rev = self.parent.db.apply(self.updates, expire_id, None).await?; - drop(store); + let rev = self + .parent + .db + .apply(self.updates, expire_id, Some(store)) + .await?; Ok(rev) } pub async fn abort(mut self) -> Result {