objectbox / objectbox/objectbox-java
ToMany considers changes applied even if put fails
@greenrobot-team 已经在做这个了。
开始于 2023年3月21日。
- 主要语言
- Java
- 星标
- 4.6k
- 派生
- 311
- PR 合并指标
- 30 天内没有已合并 PR
描述
ObjectBox version (are you using the latest version?): 3.5.0
Reproducibility: Every time
Device: Multiple Android devices
OS: Android
Hi, I'm wondering whether the issue I'm experiencing is a intended behavior or a bug.
Our working flow goes like this:
We have a model with a lot of different fields but two most important ones are ToMany relations with list of specific events. Single object that contains all of the data that we are adding to the database, and the said object gets updated till the data gets uploaded to our server, and the cleared and deleted from the database.
Under specific circumstances the database gets full and we have a need to extend it.
We do so by caching the exception, closing the database, increasing the maxSizeInKByte value and rebuilding it. The problem I have noticed is it that when Objectbox tries to add data after the database has extended it won't add the events (that are stored in the Lists and are connected to the main object by ToMany relations) that happened in those last few seconds between us closing the database and rebuilding it. Or to be more precise the data that was supposed to be added but wasn't successfully because of the exception will never be added, even though it's still in the object itself, and the same said object always is sent to be added.
I'm guessing this has something to do with caching or some similar mechanism, here is what else I tried:
- Deleting all files from the database and re-adding the object -> results in only data after extending the database being added (which confirms in someway that the data that Objectbox added before isn't getting re-added for some reason, even though database is empty and the object still has the data)
- Serializing and deserializing the object so it has a completely new memory address, still the same result as in 1.
- Playing around with ids of ToMany objects, methods like reset(), setTarget() and so on, nothing has worked so far.
Please if you could point me into the right direction and tell me what I'm doing wrong it would be greatly appreciated.
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
评估
这个 Issue 还没有评估数据。