objectbox-c icon indicating copy to clipboard operation
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

Open lymslive opened this issue 1 year ago • 4 comments

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

lymslive avatar Aug 23 '23 06:08 lymslive

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).

greenrobot avatar Aug 23 '23 06:08 greenrobot

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

paulocoutinhox avatar Dec 12 '23 16:12 paulocoutinhox

  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.)

greenrobot avatar Dec 17 '23 10:12 greenrobot

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

paulocoutinhox avatar Dec 17 '23 17:12 paulocoutinhox