users@glassfish.java.net

Container injected _at_Resource fields should be declared "volatile"?

From: <glassfish_at_javadesktop.org>
Date: Fri, 16 Nov 2007 04:46:00 PST

While reviewing a document, I stumbled upon a recommendation that said, when you are
injecting fields annotated with javax.annotation.Resource, you should consider making these
fields /volatile/, like:

@Resource
private volatile FooResource foo;

Please discuss why and if this is a good practice.

Regards,
Kedar
[Message sent by forum member 'km' (km)]

http://forums.java.net/jive/thread.jspa?messageID=245805