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: version-number/README.md
+48-33Lines changed: 48 additions & 33 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,7 @@ Ensure data consistency and integrity by tracking changes to data with version n
21
21
22
22
## Explanation
23
23
24
-
Realworld example
24
+
Real-world example
25
25
26
26
> Consider a library system where multiple librarians can update the details of books simultaneously. Each book entry in the library's database has a version number. When a librarian wants to update a book's details, the system checks the version number of the entry. If the version number matches the current version in the database, the update proceeds, and the version number is incremented. If the version number has changed, it means another librarian has already updated the book details, prompting the system to notify the librarian of the conflict and suggesting a review of the latest changes. This ensures that updates do not overwrite each other unintentionally, maintaining data integrity and consistency.
27
27
@@ -43,10 +43,10 @@ We have a `Book` entity, which is versioned, and has a copy-constructor:
43
43
@Getter
44
44
@Setter
45
45
publicclassBook {
46
+
46
47
privatelong id;
47
48
privateString title ="";
48
49
privateString author ="";
49
-
50
50
privatelong version =0; // version number
51
51
52
52
publicBook(Bookbook) {
@@ -62,6 +62,7 @@ We also have `BookRepository`, which implements concurrency control:
0 commit comments