microstream icon indicating copy to clipboard operation
microstream copied to clipboard

LegacyTypeMapping - add feature to rewrite all objects in DB to actual state

Open zdenek-jonas opened this issue 5 years ago • 5 comments

Add feature, to rewrite all objects already saved in DB to actual state by legacy type mapping.

In DB world is something like "Vertical Partitioning".
One example. I have an class Person with photo. After 10 000 saved Person i recognize, the photo takes lot of memory and i will add photo as a subclass for person with lazy. I can do it, and add to in LegacyTypeMapping in CSV file. The Person will now correct saved and old one will correct loaded. But the memory problem is still there.

+-------+                +----------+       +--------+
| name  |                | name     |       | Photo  |
| photo |                | Lazy     +-------+        |
|       |    +------->   |          |       +--------+
|       |                |          |
|       |                |          |
|       |                |          |
+-------+                +----------+


So i would like to have a feature, what this whole CSV file reads and updates the existing elements in storage to actual versions.

zdenek-jonas avatar Jan 15 '20 09:01 zdenek-jonas

Are there any plans to implement this feature?

JohannesRabauer avatar Dec 23 '21 10:12 JohannesRabauer

Maybe this can be archieved with the existing APIs. Just rewirite the whole storage root with an eager storer

hg-ms avatar May 03 '22 07:05 hg-ms

Some new utility classes that help to update the persisted state of legcy type mapped instances: feature/LegacyTypeMapping_updatePersistedState_#191

hg-ms avatar Jul 04 '22 12:07 hg-ms

Is there some update with the "PersistenceLegacyTypeHandler"?

JohannesRabauer avatar Sep 15 '22 13:09 JohannesRabauer

The code is not yet merged into the main Microstream branch. If you need that feature, the code in the feature branch works and it should be easy to adapt the code so that you can use it without modifying Microstream.

hg-ms avatar Sep 16 '22 09:09 hg-ms