Browse Source

Limit book count in database: Add SQL notes

Signed-off-by: Pekka Helenius <fincer89@hotmail.com>
v0.0.4-alpha
Pekka Helenius 4 years ago
parent
commit
1f108c9cfb
2 changed files with 14 additions and 0 deletions
  1. +7
    -0
      bookstore/src/main/java/com/fjordtek/bookstore/web/BookBasePathAwareController.java
  2. +7
    -0
      bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java

+ 7
- 0
bookstore/src/main/java/com/fjordtek/bookstore/web/BookBasePathAwareController.java View File

@ -123,6 +123,13 @@ public class BookBasePathAwareController {
* In real life, this must never be a case!
* Instead, we should have a proper admin-only
* configuration panel where to set these values.
*
* On SQL server, consider adding the following
* configuration:
*
* ALTER TABLE BOOK MAX_ROWS=<number>;
*
* See also: https://dev.mysql.com/doc/refman/5.7/en/table-size-limit.html
*/
if (webRestrictions.limitBookMaxCount("prod")) {
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);


+ 7
- 0
bookstore/src/main/java/com/fjordtek/bookstore/web/BookController.java View File

@ -209,6 +209,13 @@ public class BookController {
* In real life, this must never be a case!
* Instead, we should have a proper admin-only
* configuration panel where to set these values.
*
* On SQL server, consider adding the following
* configuration:
*
* ALTER TABLE BOOK MAX_ROWS=<number>;
*
* See also: https://dev.mysql.com/doc/refman/5.7/en/table-size-limit.html
*/
if (webRestrictions.limitBookMaxCount("prod")) {
redirectAttributes.addFlashAttribute(


Loading…
Cancel
Save