3 Replies Latest reply: Mar 27, 2009 12:41 PM by Greybird-Oracle RSS

    Conversion questions (DPL)

    607790
      Hi folks,

      I've added some code to do a simple entity upgrade. I'm actually not even really changing anything -- I have some data in a byte array, and I need the data to be gziped. I have created a Conversion for it and it seems to work just fine. What I don't see (and was surprised by) is a way to persist the upgrade. Does the conversion code really have to run every time? I assume there is some caching, but if I restart my process, is it expected that any and all conversions will have to run again until such time as I do a "put" for the object? If so, is there a way to know, for a particular object, when a conversion was done?

      Also, a related question: While my conversion object is invoked when appropriate, I also tried using EntityStore.evolve (the javadoc describes the object as being "updated" after conversion, so maybe this persists the change?), but it returns immediately, reporting that 0 entities were read. I call this after I've fully opened the store (after doing setMutations). I tried with an empty EvolveConfig and one where I call addClassToEvolve(MyClass.class.getName()). Am I missing or misunderstanding something?

      Thanks!
      Jeff
        • 1. Re: Conversion questions (DPL)
          Greybird-Oracle
          Hi Jeff,

          The converted entity is persisted when you write it with a put() method or use EntityStore.evolve(). So the only issue is why evolve() is not working for you. Could you please send

          - version of JE
          - before/after versions of your classes
          - code to do the evolve()
          - a test or procedure for demonstrating the problem

          Probably best to send email instead of posting all this. Send to mark.hayes at the obvious (oracle.com).

          --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
          • 2. Re: Conversion questions (DPL)
            Greybird-Oracle
            For the record, this turned out to be a bug in EntityStore.evolve where it does not return the stats (they are all zero) when an EvolveListener is not configured. The evolution takes place, but the stats returned are zero. The workaround is to configure an EvolveListener using EvolveConfig.setEvolveListener. This will be fixed in the next JE 3.3.x release. The ticket for this is #17024.

            --mark                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       
            • 3. Re: Conversion questions (DPL)
              607790
              And thank you Mark for your excellent help, as always!

              Jeff