[#6561] Manual section about optimistic locking has invalid code
This commit is contained in:
parent
d1d6e280a9
commit
c371d81eec
@ -6577,8 +6577,8 @@ Factory optimistic = new Factory(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -6610,8 +6610,8 @@ Factory optimistic = new Factory(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -7141,8 +7141,8 @@ Factory optimistic = new Factory(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -7174,8 +7174,8 @@ Factory optimistic = new Factory(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -8558,8 +8558,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -8591,8 +8591,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -9087,8 +9087,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -9120,8 +9120,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -13033,8 +13033,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -13066,8 +13066,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -9426,8 +9426,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -9459,8 +9459,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -10259,8 +10259,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -10292,8 +10292,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -11228,8 +11228,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -11261,8 +11261,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -11662,8 +11662,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -11695,8 +11695,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -12062,8 +12062,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -12095,8 +12095,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -12465,8 +12465,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -12498,8 +12498,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -12689,8 +12689,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -12722,8 +12722,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
@ -12854,8 +12854,8 @@ DSLContext optimistic = DSLContext.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The underlying database record has not been modified, it can be safely updated.
|
||||
book1.setTitle("Animal Farm");
|
||||
@ -12887,8 +12887,8 @@ DSLContext optimistic = DSL.using(connection, SQLDialect.ORACLE,
|
||||
new Settings().withExecuteWithOptimisticLocking(true));
|
||||
|
||||
// Fetch a book two times
|
||||
BookRecord book1 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetch(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book1 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
BookRecord book2 = optimistic.fetchOne(BOOK, BOOK.ID.eq(5));
|
||||
|
||||
// Change the title and store this book. The MODIFIED value has not been changed since the book was fetched.
|
||||
// It can be safely updated
|
||||
|
||||
Loading…
Reference in New Issue
Block a user