objectbox-java: .removeAll() freezes indefinitely
#764 Issue Basics
- ObjectBox version :
2.5.1,3.0.0-alpha2 - Reproducibility: always
Reproducing the bug
Description
When calling removeAll() on an Entity, DB operation freezes
Code
box.removeAll()
Entities
@Entity
data class MyEntity(
@Id
var id: Long? = null,
@Uid(5199960888095114421L)
var idA: Int? = null,
@Uid(8980596607626398101L)
var idB: String? = null,
@Uid(8428670953150503097L)
var idC: Int? = null
)
Misc
box.remove(box.all)
works
- I’m calling all this in a worker
- Earlier when
enititeshad a default values like" "forstringetc, it worked, but now have made all such fieldsnullablewith default null. - It works for the first time when app is installed ( In the worker, first
removeAlland thenputa list of entities), but when we sync again i.e.removeAllandput, it just freezes onremoveAll - I’m also observing the DB.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 23 (10 by maintainers)
@greenrobot @greenrobot-team Thanks a lot guys! Just tested
2.7.0and everything is working fine now ( will be testing more ).Now I realise that it all started happening after I added relations. But adding relations, affected other plain (without relations) models also.
Can you please share how did you reproduced the issue? Thanks again
We were able to track it down in Go: https://github.com/objectbox/objectbox-go/issues/25
OK, having two versions with two outcomes is a good starting point. E.g. now you can adjust the working one step-by-step until it stops working to get closer to the cause…
It’s an interesting observation and I have no idea… (It’s also much more inefficient…) However, this changes some timings and transaction sequences (box.all is a read TX before doing a write TX).