objectbox-c
objectbox-c copied to clipboard
The database file seems to have a limit of 1G, thens throws an exception when trying to put more objects
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):
- ObjectBox version: latest version 0.18.0
- C++11, gcc 4.8.5
- OS: centos 7.9
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 obx_opt_*() 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)
.
1 - There is an option for auto limit or no limit? 2 - When you increase the DB size, the existing databases break?
- Set the limit to a value that you are sure you will never hit
- 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.)
@greenrobot can you help me here too https://github.com/objectbox/objectbox-c/issues/25 ? thanks.