Pat Farrell wrote:I make using the cache transparent to users (aka other developers). Its an engineering decision which objects get cached. I put the cache in the BusinessObject layer, as part of the ORM. This approach is not 100% transparent to the users, for instance, if your Person object is cached, the normal access to an object via its primary key is
Person aper = Person.getFromId(primkey);
instead of the usual
Person aper = new Person(primkey);
Pat Farrell wrote:I'm not sure what you are asking. Generally, you can use someone else's cache implementation, or you can write your own.
I like one that I've implemented, its a WorkingSetCache based on Denning's work on locality and cache efficiency. Open source code at
http://pfarrell.com/java/pdflib.tar.gz
To get good performance, you have to engineer the design of the cache with the production environment. For example, many cache schemes use a LRU (least recently used) which is simple to program, explain and test. It usually works fairly well, but can fail badly in some cases.
Joe Ess wrote:Do not do this. ready() does not tell you if the stream has ended, it tells you if a read call will block:
David Newton wrote:A CSV file *is* a text file.
Joe Ess wrote:InputStream -> InputStreamReader -> BufferedReader
Originally posted by Merrill Higginson:
Yes, they are. Struts cleans them out for each new action. That's one of the disadvantages of "action chaining". You will have to come up with some other way of passing messages from one action to another, such as storing them under a different key in the request and then having the second action retrieve them under that key and rewriting them using the saveErrors method.