🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #477

java.util.prefs building "pyramids"

#477
From: Adam Gawne-Cain
Date: Fri, 19 Sep 2003 06:22
41 lines
2085 bytes
Hi all,

I am using java.util.prefs.Preferences
In the Windows JVM this is backed by the Win32 Registry.

My problem is that sometimes when I create a node like "12345678" I get a
series of keys in the Win32 registry as follows:

1
12
123
1234
12345
123456
1234567
12345678

All of the keys are at the same level, with the correct parent, and empty.

This problem is intermittent.  My users have seen it happen in Win2000 and
NT4.
It has happened with JRE 1.4.1 and JRE1.4.2.

More info: since it is quite likely that users will be running several
instances of my programs on one machine (ie different JVMs are accessing the
Win32 registry simultaneously), I have coded my calls to
java.util.prefs.Preferences with the sync() method just before reading keys,
and the flush() method just after writing keys.  However, the problem occurs
when only one JVM is operating.


I guess that this is a JRE/Win32 bug, but I would like to know a safe
work-around.  (Is the problem using digits in the key name, or using
flush()/sync()?)

Has anyone else seen a similar bug?
Can anyone confirm that this is a JRE/Win32 bug?
Does anyone know a work around?

Thanks in advance,
Adam.
Technical Details
Message-ID: <3f6aa013$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,1872eda4636e4644,start
X-Google-Attributes: gid1089d0,public
X-Google-ArrivalTime: 2003-09-18 23:26:35 PST
From: "Adam Gawne-Cain" <adam@gawnecainresearch.co.uk>
Newsgroups: borland.public.jbuilder.java.api
Subject: java.util.prefs building "pyramids"
Date: Fri, 19 Sep 2003 15:22:42 +0900
Lines: 43
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 61.199.18.64
Message-ID: <3f6aa013$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1063952403 61.199.18.64 (18 Sep 2003 23:20:03 -0700)
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail