So the feature request sounded "reasonable". From my web based Java
module, which is primarily a tag library that reads in and is wholly
dependent upon  xml files from the local file system (through
URLClassLoader), devise a fallback strategy if for some some reason
the source xml files should become unavailable or corrupted. My
application checks for updates to these files on a configurable
interval. If an update is indicated, the file is reread and the cache
refreshed.

Hey, I've done this in desktop applications... read in a file... it's
good, copy the contents to a "known good" location on the file system.
Perform this operation on each subsequent positive read. If for some
reason a read goes awry, load in the prior good version, issue a error
to the log and continue.

Problem is, this isn't as straight forward in a web application
environment. By design there is little if any direct file system
access from a web module. And for what there is (from what I've been
able to determine) there's no guarantee that one approach is portable
from one web server to the next.

That said, I'm asking the group if there is a "simple" solution to
this. While I could go through the overhead of configuring a database
in the backend for storing the deltas it seems a bit of an overkill
for the task. I want to avoid over-engineering the solution (after
all, if the source xml files are broken, this is a serious matter...
it really should fail severely so it gets attention).

While writing this (sorry for the long winded post) I have come up
with a simple solution... if the subsequent read of the source fails
issue the error and simply don't refresh the cache... but my question
is now more out of curiosity and  academic. What reasonably simple
approach(es) can be utilized to handle this requirement (again,
outside of harnessing a datasource)?

thanks,
K2

-- 
You received this message because you are subscribed to the Google
Groups "Java EE (J2EE) Programming with Passion!" group.
To post to this group, send email to
java-ee-j2ee-programming-with-passion@googlegroups.com
To unsubscribe from this group, send email to
java-ee-j2ee-programming-with-passion+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/java-ee-j2ee-programming-with-passion?hl=en?hl=en

Reply via email to