objectbox / objectbox/objectbox-java

Upgrading from Objectbox v1.5 to v2.x fails with index on unsupported property

Ouverte
#712 2 commentaires 1 réaction 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

bug
Langage dominant
Java
Étoiles
4.6k
Forks
311
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

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

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par la reproduction en Java décrite dans l’issue : créez une base de données v1.5 avec des champs Double indexés, puis effectuez une mise à niveau vers ObjectBox 2.3.4 après avoir supprimé les annotations. Suivez la gestion de la migration pour l’index hérité qui déclenche la DbException ; le travail est terminé lorsque la base de données existante s’ouvre correctement sans l’index obsolète et conserve ses données.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
java
Domaine
databases
Type d'issue
Bug
Difficulté
4/5
Temps estimé
3-5 jours
Activité
À l'abandon
Clarté
Clairement spécifiée
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.