Java persistence

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Frank Grimm

    #1

    Java persistence

    Hi group,

    i'm looking for a Java persistence framework that is able to cope with
    changes of the class source, i.e. new/changed attributes and/or
    methods. Say you have an exported (persistent) instance of a old class
    version and want to reload it into a newly started program that uses a
    new version of the class. Is there some framework that can do the job
    or do i have a strange idea of what instance persistence realy is?


    Thanks, Frank.

  • Dan Nuttle

    #2
    Re: Java persistence

    Unless one of the truly world-class propeller heads can prove me wrong, I'm
    going out on a limb and saying that, if your class definition changes in
    your code, then you can't load an instance of an earlier version of the
    class into the JVM running the new version.

    "Frank Grimm" <fgrrgf@netscap e.net> wrote in message
    news:1109595738 .109080.209410@ f14g2000cwb.goo glegroups.com.. .[color=blue]
    > Hi group,
    >
    > i'm looking for a Java persistence framework that is able to cope with
    > changes of the class source, i.e. new/changed attributes and/or
    > methods. Say you have an exported (persistent) instance of a old class
    > version and want to reload it into a newly started program that uses a
    > new version of the class. Is there some framework that can do the job
    > or do i have a strange idea of what instance persistence realy is?
    >
    >
    > Thanks, Frank.
    >[/color]


    Comment

    • Oliver Wong

      #3
      Re: Java persistence


      "Dan Nuttle" <d_nuttle@hotma il.com> wrote in message
      news:wStYd.1543 $qf2.351@newsre ad2.news.atl.ea rthlink.net...[color=blue]
      > Unless one of the truly world-class propeller heads can prove me wrong,
      > I'm
      > going out on a limb and saying that, if your class definition changes in
      > your code, then you can't load an instance of an earlier version of the
      > class into the JVM running the new version.[/color]

      It may be possible using reflection, but the problem is ill-defined. If
      for example, you have a field called "foo", and then you rename the field
      "bar", is the persistence framework supposed to be able to guess that "bar"
      is a renaming of "foo" and not just an entirely new field (which
      coincidentally appear just when the field "foo" disappeared)?

      There's no technical reason why this wouldn't be possible, only
      pragmatic/business-rule reasons.

      - Oliver


      Comment

      Working...