Re: Arguable bug in PrevaylerDirectory
"Justin T. Sampson" <[email protected]>
| Newsgroups | gmane.comp.java.prevayler |
|---|---|
| Message-ID | <[email protected]> |
I actually made this change already on the master branch in Git, as yet unreleased. Of course, you can also just rename your 0.snapshot to 1.snapshot. :) (Left-padded with eighteen zeros, of course.) Cheers, Justin On Sun, Jan 10, 2010 at 12: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