Search the archives!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with Resource Bundle caching>> I suspect
- From: ash_kos@xxxxxxxxxxx (Asish koshy)
- Subject: Problem with Resource Bundle caching>> I suspect
- Date: Sat, 30 Oct 1999 08:22:52 PDT
Dear All,
I am working on a module which will help in online translation of the
resource files of our project.
There is a screen in which i show all the Resource Tags (Keys ) in a table.
As and when the user selects a tag,the text/message for the tag in the
default locale, which also serves as a reference to the user is displayed
in a read only text area(let's call it txa1) and there is another text
area(let's call it txa2) where the user can specify the text in another
locale.If the user has already specified a message for this tag in the new
locale , this will appear in txa2. He/she can change it to a new message.
I populate the Resource Tags when the screen is loaded.Actually I create an
exact copy of the resource file(let's call it Res1) in the default locale
but with changed naming convention to suit the new locale to which the files
will be translated.
I am actually creating a RandomAccessFile in the 'rw' mode initially to
display the message in txa2.
When the user moves from one row to another in the Resource Tag table, and
if the user has specified any message against the key for the new locale, I
write it to Res1, against the partcular tag.
My problem is , even though the change i made is reflected in Res1
, the old message appears in txa2, when the user moves to another row of the
Resource Tag table and comes back to the original row for which the user
just defined the message.
I know that when we specify the
ResourceBundle Res1 = ResourceBundle.getBundle("FileA" ,new
Locale(LangCodeA,CountryCodeA)) method it creates an internal hashtable for
caching.
I suspect that this is not taking place again when after writing into Res1 i
do a
Res1 = ResourceBundle.getBundle("FileA" ,new Locale(LangCodeA,CountryCodeA))
even though the file FileA has changed.As a result i am getting back the
message before change by the user.
Howver if I close my application , the change the user made appears and then
the same story goes on.
I have even tried closing the RandomAccessFile and then do
Res1 = ResourceBundle.getBundle("FileA" ,new
Locale(LangCodeA,CountryCodeA))but to no avail.
Am i correct in my conclusion that Java caches the contents when a
ResourceBundle is first created and then retains the same cache inspite of
further initailisations unless the application is closed.
I will be very grateful if someone can help me out.
Best Regards
Asish
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
---
To unsubscribe, mail advanced-java-unsubscribe@xxxxxxxxxxxxxxxx
To get help, mail advanced-java-help@xxxxxxxxxxxxxxxx
- Prev by Date: Compilation problem with decompiled code...
- Next by Date: Scrolling HTML in a JEditorPane
- Previous by thread: Compilation problem with decompiled code...
- Next by thread: Scrolling HTML in a JEditorPane
- Index(es):