objectbox / objectbox/objectbox-java
Upgrading from Objectbox v1.5 to v2.x fails with index on unsupported property
Ninguém assumiu esta issue ainda.
- Linguagem predominante
- Java
- Estrelas
- 4.6k
- Forks
- 311
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
Issue Basics
- ObjectBox version: 1.5 upgrading to 2.x (2.3.4 at time of writing)
- Reproducibility: always
Reproducing the bug
Create project with objectbox v1.5, define Object with Entity.
@Entity
public class Foo {
@Index private Double Lat;
@Index private Double Lng;
}
Compile and run project, in order to create the objectbox DB and save some instances.
Update the objectbox version in the project to 2.3.4, then update the entity by removing the @Index annotations
Update the entity to
@Entity
public class Foo {
private Double Lat;
private Double Lng;
}
Recompile and run project again. You will get the following Exception:
io.objectbox.exception.DbException: Indexing of float and double is currently unavailable. Please remove the index on Property Lat (5, Double)
Description
This bug has been already mentioned and discussed in the StackOverflow Thread https://stackoverflow.com/questions/54149954/double-field-index-problem-when-upgrading-objectbox-library
Upgrading the objectbox instance from 1.5 to 2.x when having an @Index set on a Double field is impossible for existing apps.
A desired way of handling this would be to remove the @Index from the existing legacy data structure internally and let the app keep the data as before, making a migration to the new objectbox version possible and seamless.
Please fix this issue as an upgrade of the module is impossible.
Code
ObjectBox v1.5
@Entity
public class Foo {
@Index private Double Lat;
@Index private Double Lng;
}
ObjectBox v2.3.4
@Entity
public class Foo {
private Double Lat;
private Double Lng;
}
triggers runtime DbException: "io.objectbox.exception.DbException: Indexing of float and double is currently unavailable. Please remove the index on Property Lat (5, Double)"
Logs & stackstraces
io.objectbox.exception.DbException: Indexing of float and double is currently unavailable. Please remove the index on Property Lat (5, Double)
Misc
Is there anything special about your app?
No
May transactions or multi-threading play a role?
No
Did you find any workarounds to prevent the issue?
No workarounds found to date
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Direção de pesquisa
Comece com a reprodução em Java descrita na issue: crie um banco de dados v1.5 com campos Double indexados e, depois de remover as anotações, faça o upgrade para o ObjectBox 2.3.4. Rastreie o tratamento da migração para o índice legado que dispara a DbException; considera-se concluído quando o banco de dados existente abre com sucesso sem o índice obsoleto e mantém seus dados.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- java
- Domínio
- databases
- Tipo de issue
- Bug
- Dificuldade
- 4/5
- Tempo estimado
- 3-5 dias
- Status de atividade
- Estagnada
- Clareza
- Claramente especificada
- Facilidade para iniciantes
- 35/100