Discussions

EJB programming & troubleshooting: sending an intance of a class to servlet from session bean

  1. I have a class with Static block Which has dao call. So when this class is called for first time static block is called . Now suppose I return instance of this class from my session bean to a servlet. Will this servlet also call static block ?
  2. General java rules should apply[ Go to top ]

    If your servlet is in a separate JVM, and in servlet's JVM return class has not been loaded into memory yet, then static block will execute. I think that same effect can be reached in the same JVM with some weird classloader isolation. -K