Skip to content

io.objectbox.exception.DbException: Could not get from cursor (-30787) (error code -30787) #1224

@andreesperanca

Description

@andreesperanca

Is there an existing issue?

Build info

  • ObjectBox version: 4.1.0
  • OS: Android 9
  • Device/ABI/architecture: Tablet Lilliput

Steps to reproduce

I haven't been able to replicate the problem, but it happens frequently on devices I don't have access to.

Expected behavior

Understanding the problem is key to solving it.

Actual behavior

The application is crashing when trying to call a simple query.

Code

Code
 override suspend fun getMessageCountFromDatabase(): Long {
        val box = equipmentMessageBoxStore.getBox(EquipmentMessageEnvelopeDTO::class.java)

        val count = box.query()
            .equal(EquipmentMessageEnvelopeDTO_.status, EquipmentMessageStatus.READY.value.toLong())
            .build()
            .use { it.count() }

        return count
    }

Init:

   @Provides
    @Singleton
    @EquipmentMessageStore
    fun provideBoxStoreMessages(
        @ApplicationContext context: Context
    ): BoxStore {
        var boxStore: BoxStore
        val storeBuilder = MyObjectBox.builder()
            .validateOnOpenKv()
            .androidContext(context)
            .name("equipment-messages")
        boxStore = storeBuilder.build()
        return boxStore
    }
  • Is there anything special about your app? No.
  • May transactions or multi-threading play a role? Yes.
  • Did you find any workarounds to prevent the issue? No.

Logs, stack traces

Logs, stack traces

io.objectbox.exception.DbException: Could not get from cursor (-30787) (error code -30787)

Unfortunately, this couldn't be reproduced, so I only have a photo of the problem occurring on a device.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions