objectbox / objectbox/objectbox-java
Upgrading from Objectbox v1.5 to v2.x fails with index on unsupported property
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Java
- Star
- 4.6k
- Fork
- 311
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu với việc tái hiện bằng Java được mô tả trong issue: tạo cơ sở dữ liệu v1.5 với các trường Double được lập chỉ mục, sau đó nâng cấp lên ObjectBox 2.3.4 sau khi xóa các annotation. Theo dõi quá trình xử lý migration đối với chỉ mục legacy gây ra DbException; hoàn tất khi cơ sở dữ liệu hiện có mở thành công mà không có chỉ mục đã lỗi thời và vẫn giữ nguyên dữ liệu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- java
- Lĩnh vực
- databases
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức phù hợp với người mới
- 35/100