You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/asciidoc/entity.adoc
+6-3Lines changed: 6 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -346,9 +346,12 @@ This is required for N1QL support.
346
346
[[version]]
347
347
== Optimistic Locking
348
348
349
-
Couchbase Server does not support multi-document transactions or rollback.
350
-
To implement optimistic locking, Couchbase uses a CAS (compare and swap) approach.
351
-
When a document is mutated, the CAS value also changes.
349
+
350
+
In certain situations you may want to ensure that you are not overwriting another users changes when you perform a mutation operation on a document. For this you have three choices: Transactions (since Couchbase 6.5), pessimistic concurrency (locking) or optimistic concurrency.
351
+
352
+
Optimistic concurrency tends to provide better performance than pessimistic concurrency or transactions, because no actual locks are held on the data and no extra information is stored about the operation (no transaction log).
353
+
354
+
To implement optimistic locking, Couchbase uses a CAS (compare and swap) approach. When a document is mutated, the CAS value also changes.
352
355
The CAS is opaque to the client, the only thing you need to know is that it changes when the content or a meta information changes too.
353
356
354
357
In other datastores, similar behavior can be achieved through an arbitrary version field with a incrementing counter.
Copy file name to clipboardExpand all lines: src/main/asciidoc/migrating.adoc
+87-2Lines changed: 87 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,15 @@ The new SDK still has an environment that is used to configure it, so you can ov
18
18
19
19
For more information, see <<couchbase.configuration>>.
20
20
21
+
=== Spring Boot Version Support
22
+
23
+
Spring Data Couchbase 4.x requires Spring Boot 2.3.x or higher.
24
+
25
+
If you are using Spring Boot in your project with Spring Data Couchbase 3.x, you will likely need to upgrade your Spring Boot version as well.
26
+
21
27
[[couchbase.migrating.entities]]
28
+
29
+
22
30
== Entities
23
31
How to deal with entities has not changed, although since the SDK now does not ship annotations anymore only Spring-Data related annotations are supported.
24
32
@@ -31,6 +39,14 @@ The `org.springframework.data.couchbase.core.mapping.Document` annotation stayed
31
39
32
40
For more information, see <<couchbase.entity>>.
33
41
42
+
43
+
[[couchbase.migrating.indexes]]
44
+
== Automatic Index Management
45
+
46
+
Automatic Index Management has been redesigned to allow more flexible indexing. New annotations have been introduced and old ones like `@ViewIndexed`, `@N1qlSecondaryIndexed` and `@N1qlPrimaryIndexed` were removed.
47
+
48
+
For more information, see <<couchbase.repository.indexing>>.
49
+
34
50
[[couchbase.migrating.template]]
35
51
== Template and ReactiveTemplate
36
52
@@ -102,12 +118,81 @@ We tried to unify and align the APIs more closely to the underlying SDK semantic
102
118
For more information, see <<couchbase.template>>.
103
119
104
120
[[couchbase.migrating.repository]]
105
-
== Repository queries
121
+
== Repositories & Queries
122
+
123
+
- `org.springframework.data.couchbase.core.query.Query` became `org.springframework.data.couchbase.repository.Query`
124
+
- `org.springframework.data.couchbase.repository.ReactiveCouchbaseSortingRepository` has been removed. Consider extending `ReactiveSortingRepository` or `ReactiveCouchbaseRepository`
125
+
- `org.springframework.data.couchbase.repository.CouchbasePagingAndSortingRepository` has been removed. Consider extending `PagingAndSortingRepository` or `CouchbaseRepository`
126
+
106
127
107
128
IMPORTANT: Support for views has been removed and N1QL queries are now the first-class citizens for all custom repository methods as well as the built-in ones by default.
108
129
109
130
The behavior itself has not changed over the previous version on how the query derivation is supposed to work. Should you encounter any queries that worked in the past and now do not work anymore please let us know.
110
131
111
132
It is possible to override the default scan consistency for N1QL queries through the new `ScanConsistency` annotation.
112
133
113
-
See <<couchbase.repository>> for more information.
134
+
The method `getCouchbaseOperations()` has also been removed. You can still access all methods from the native Java SDK via the class `CouchbaseTemplate` or `Cluster`:
0 commit comments