Hey
Carlos Valiente wrote:
> > My question is, when I copy a new version of a EJB into jBoss' deploy
> > directory, and it gets auto deployed, my web page doesn't seem to use the
> > new object until I start and restop jBoss. Why? My environment is Tomcat
> > + Apache + Jboss.
>
> I experience the same thing --- the quick&dirty trick I've found is to
> restart *Tomcat*: I've put the EJB initialization stuff
> (InitialContext.lookup(), PortableRemoteObject.narrow() and
> home.create()) in my servlet's init() method. If I redeploy the EJB jar,
> it seems that I have to call al those methods again.
>
> I'm afraid I'm doing something *COMPLETLY* wrong ;-)
You are doing it wrong, and I'm sorry it works; it should crash right
after re-deploy. (NOTE: not when fail-over is implemented though!)
This kind of code will be self-defeating in the future though: when
clustering is added, the load-balancing decisions will most likely be on
home.create(), so any such caching in your servlet will make the system
perform worse ('cause the decision will only be made once). This goes
pretty much for the commercial vendors solutions as well, so it wouldn't
be just us.
For each page request, get new InitialContext() (which is cached
internally anyway, so it is VERY fast to do it!), lookup the home and
create your session. When fail-over is done this should be changed so
that you do lookup once, and then home.create on each page request.
Ok?
/Rickard
--
Rickard �berg
Email: [EMAIL PROTECTED]
http://www.telkel.com
http://www.jboss.org
http://www.dreambean.com
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]