Re: Arguable bug in PrevaylerDirectory
Karl Wettin <[email protected]>
| Newsgroups | gmane.comp.java.prevayler |
|---|---|
| Message-ID | <[email protected]> |
Alright then! At least I've sounded my opinion now. ;)
karl
11 jan 2010 kl. 04.18 skrev Klaus Wuestefeld:
> Hi Karl,
>
> We have discussed this in the remote past and it was fun. :)
>
> Conceptually, your migration should be one huge "import" transaction.
>
> In strict prevalence, there is no such thing as "just raw [write]
> access to my root object".
>
> If you are old enough to break the rules, you are old enough to either
> rename the snapshot file or run one dummy transaction before taking
> the snapshot.
>
> See you, Klaus.
>
>
> On Sun, Jan 10, 2010 at 6:46 PM, Karl Wettin <[email protected]>
> wrote:
>> Hi fora,
>>
>> PrevaylerDirectory row 99 is:
>>
>> long latestVersion = 0;
>>
>> I claim this is a bug, that it should be -1:
>>
>> File latestSnapshot = null;
>> long latestVersion = -1;
>> for (int i = 0; i < files.length; i++) {
>> File candidateSnapshot = files[i];
>> long candidateVersion =
>> snapshotVersion(candidateSnapshot);
>> if (candidateVersion > latestVersion) {
>> latestVersion = candidateVersion;
>> latestSnapshot = candidateSnapshot;
>> }
>> }
>>
>> One could argue that version 0 never would exist, but I say it might.
>> In my case I've been migrating my data from an old system to
>> Prevayler
>> without using transactions, just raw access to my root object. Taking
>> a snapshot will produce version 0. With latestVersion initialized
>> as 0
>> this snapshot will not be loaded.
>>
>>
>> karl
>>
>>
>> ------------------------------------------------------------------------------
>> This SF.Net email is sponsored by the Verizon Developer Community
>> Take advantage of Verizon's best-in-class app development support
>> A streamlined, 14 day to market process makes app distribution fast
>> and easy
>> Join now and get one step closer to millions of Verizon customers
>> http://p.sf.net/sfu/verizon-dev2dev
>> _______________________________________________
>> To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
>> _______________________________________________
>> "Databases in Memoriam" -- http://www.prevayler.org
>>
>
> ------------------------------------------------------------------------------
> This SF.Net email is sponsored by the Verizon Developer Community
> Take advantage of Verizon's best-in-class app development support
> A streamlined, 14 day to market process makes app distribution fast
> and easy
> Join now and get one step closer to millions of Verizon customers
> http://p.sf.net/sfu/verizon-dev2dev
> _______________________________________________
> To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
> _______________________________________________
> "Databases in Memoriam" -- http://www.prevayler.org
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
To unsubscribe go to the end of this page: http://lists.sourceforge.net/lists/listinfo/prevayler-discussion
_______________________________________________
"Databases in Memoriam" -- http://www.prevayler.org