AFAIK there is no option to destroy one SessionBean.
But if you repack your app you can use the hotdeploy feature (replace the jar/war/ear in deploy directory).
Your app will be completly undeployed and the new one will start.
Thank you so much.
AFAIK Session bean (EJB) was born to make Enterprise application modular, and developing a module is independent to each other. If I want to modify a module is simple and do not disturb any other modules. I though I could off a module, modify this, reload it while the others was still running...
Could you so me the way to implement this great thing!
As far as I understand the way for you is to pack the EJB's into different JAR files.
In this case you might able to redeploy one of it.
But remember that, in case of (declared) dependencies between, JBoss will deactivate applications that depend on the current redeploy.
If you not declare the dependency within the deployment descriptor I'm not sure what happen, I suppose that the reference to the local EJB interface will become invalid and you have to implement a retry mecanism.
Yes, from now, I must pack my EJBs into different JAR files, and all reference to another EJB, I used JNDI lookup instead of @EJB injection (I mean local EJB) also following a retry mechanism. I think this way leak performance of my app ( each operation with another EJB must look up in JNDI server... ) but each EJB is independent to others. Perhaps, I must decide which EJB is modular, not all EJB do .
Do you think I do it in right way?
For performance I would encapsulate the JNDI lookup and store the reference during @PostConstruct and handle it at runtime via method instead of direct variable access.
The method might check the reference or you re-lookup only in case of problems with the local-IF.
Do every JavaEE developer design their app with that way ?
(I'm newbie )
Don't frown. I know many experienced developers with similar questions. Everyone is on the same path, just not at the same stage. Better to reach out early in the process and avoid costly mistakes. I'd be happy to connect you to another community project around JBoss Enterprise and EJB3.1 Good Luck!