objectbox / objectbox-c

C and C++ database for objects and structs
https://objectbox.io/
Apache License 2.0
211 stars 37 forks source link

The database file seems to have a limit of 1G, thens throws an exception when trying to put more objects #35

Open lymslive opened 1 year ago

lymslive commented 1 year ago

Describe the bug I just test transfer large data from another database to objectbox, where each record has about 3000 fields. When I have put about 40000 records into objectbox, and the file objectbox/data.mdb reach about 1GB size, then it refuse to put any more new object.

Throw obx::DbException with wath() message: Could not put. And print Storage error(code -30792)

Basic info (please complete the following information):

greenrobot commented 1 year ago

The 1 GB is a default, which can be changed via options. In C++ there's an Option class for that and in C there are obxopt*() functions. These options have to be prepared before opening the store.

To increase the DB limit, use obx::Options::maxDbSizeInKb(uint64_t sizeInKb) in C++. For C, it's obx_opt_max_db_size_in_kb(OBX_store_options *opt, uint64_t size_in_kb).

paulocoutinhox commented 11 months ago

1 - There is an option for auto limit or no limit? 2 - When you increase the DB size, the existing databases break?

greenrobot commented 11 months ago
  1. Set the limit to a value that you are sure you will never hit
  2. The max DB size can be changed without affecting the database

(I'm still leaving this issue open to improve our docs page with the information.)

paulocoutinhox commented 11 months ago

@greenrobot can you help me here too https://github.com/objectbox/objectbox-c/issues/25 ? thanks.