Chuck Hill wrote on 11/13/07 6:24 PM:
>
> On Nov 13, 2007, at 3:02 PM, Zak Burke wrote:
>
>> Mike Schrag wrote on 11/13/07 4:30 PM:
>>>> I can only assume his java files are doing something funky in a
>>>> static block or something?
>>> Oh right .. looking at that stack trace for 5 seconds:
>>> at edu.dartmouth.dltg.pns.eos.SourceDnd.sourceDndById(SourceDnd.java:45)
>>> at edu.dartmouth.dltg.pns.eos.SourceDnd.<clinit>(SourceDnd.java:20)
>>> You're doing EOF stuff in a static initializer. This is just a bad
>>> idea. You should really do this kind of initialization after your
>>> app loads
>>
>> Ah; that's good to know. ... How should I have known? This is the part
>> of WO programming that sometimes drives me nuts: there's some Java
>> pattern that is normal
>
> Fetching from a database in a static initializer is a normal Java
> pattern? Uh, you sure about that?
The "normal Java pattern" part was using static ivars as constants; the
DB access is my own special sauce.
So I guess it's me that drives me nuts, not WO. I really need to find a
mid-level java overview book; not how-to-program, but how-things-work.
I've never had occasion to learn much about the classloader, or how the
JVM handle static initialization, but these are clearly things worth
knowing about, since it was immediately obvious to you and Mike and Anjo
exactly how I was abusing the language to shoot myself in the foot just
so. Not that I expect a book to instantly enlighten me and keep me from
posting stupid questions to every list I subscribe to, but it might help
a little bit. Any recommendations?
Thanks, as always, for correcting my course.
zak.
This archive was generated by hypermail 2.0.0 : Tue Nov 13 2007 - 19:12:05 EST