34
34
import io .objectbox .annotation .apihint .Experimental ;
35
35
import io .objectbox .annotation .apihint .Internal ;
36
36
import io .objectbox .exception .DbException ;
37
+ import io .objectbox .exception .DbFullException ;
38
+ import io .objectbox .exception .DbMaxDataSizeExceededException ;
37
39
import io .objectbox .flatbuffers .FlatBufferBuilder ;
38
40
import io .objectbox .ideasonly .ModelUpdate ;
39
41
import io .objectbox .model .FlatStoreOptions ;
@@ -333,10 +335,13 @@ BoxStoreBuilder modelUpdate(ModelUpdate modelUpdate) {
333
335
334
336
/**
335
337
* Sets the maximum size the database file can grow to.
336
- * By default this is 1 GB, which should be sufficient for most applications .
338
+ * When applying a transaction (e.g. putting an object) would exceed it a {@link DbFullException} is thrown .
337
339
* <p>
338
- * In general, a maximum size prevents the DB from growing indefinitely when something goes wrong
339
- * (for example you insert data in an infinite loop).
340
+ * By default, this is 1 GB, which should be sufficient for most applications.
341
+ * In general, a maximum size prevents the database from growing indefinitely when something goes wrong
342
+ * (for example data is put in an infinite loop).
343
+ * <p>
344
+ * This value can be changed, so increased or also decreased, each time when opening a store.
340
345
*/
341
346
public BoxStoreBuilder maxSizeInKByte (long maxSizeInKByte ) {
342
347
if (maxSizeInKByte <= maxDataSizeInKByte ) {
@@ -349,13 +354,17 @@ public BoxStoreBuilder maxSizeInKByte(long maxSizeInKByte) {
349
354
/**
350
355
* This API is experimental and may change or be removed in future releases.
351
356
* <p>
352
- * Sets the maximum size the data stored in the database can grow to. Must be below {@link #maxSizeInKByte(long)}.
357
+ * Sets the maximum size the data stored in the database can grow to.
358
+ * When applying a transaction (e.g. putting an object) would exceed it a {@link DbMaxDataSizeExceededException}
359
+ * is thrown.
360
+ * <p>
361
+ * Must be below {@link #maxSizeInKByte(long)}.
353
362
* <p>
354
363
* Different from {@link #maxSizeInKByte(long)} this only counts bytes stored in objects, excluding system and
355
364
* metadata. However, it is more involved than database size tracking, e.g. it stores an internal counter.
356
365
* Only use this if a stricter, more accurate limit is required.
357
366
* <p>
358
- * When the data limit is reached data can be removed to get below the limit again (assuming the database size limit
367
+ * When the data limit is reached, data can be removed to get below the limit again (assuming the database size limit
359
368
* is not also reached).
360
369
*/
361
370
@ Experimental
@@ -455,7 +464,7 @@ public BoxStoreBuilder debugRelations() {
455
464
* {@link io.objectbox.exception.DbException} are thrown during query execution).
456
465
*
457
466
* @param queryAttempts number of attempts a query find operation will be executed before failing.
458
- * Recommended values are in the range of 2 to 5, e.g. a value of 3 as a starting point.
467
+ * Recommended values are in the range of 2 to 5, e.g. a value of 3 as a starting point.
459
468
*/
460
469
@ Experimental
461
470
public BoxStoreBuilder queryAttempts (int queryAttempts ) {
0 commit comments