Second question first. No static objects in EJBs unless they are "final"! The EJB itself and its contents should be considered as distinct entities. When you need an EJB for specific data, the container creates a new EJB, pulls an idle one from cache, or selects a least-recently-used EJB (in this case, causing its contents to be written to persistent storage -- "paged out", if you like). The new, "blank" EJB is then filled in with the data. So necessarily, one EJB must be interchangable with any other of the same class.
EJBs run in a multi-threaded environment and depending on your selected transaction mode this could be hazardous to static data, but for a more complete and accurate description of why you shouldn't even consider this, I recommend you read the "thou shalt not" section of the EJB spec - it gives the reasons why.
I think you're also confused about what "static" means. In
Java, static means that the item is attached to the class rather than to an instance of the class, so if you set "price" as a static field to "$15.00", it would be $15.00 for all of that kind of object. I think what you wanted was "final", which means that the value is constant and will never change.
[ February 18, 2002: Message edited by: Tim Holloway ]