Hmmmm... No answer from anybody.
I should probably clarify my message. For me (and I believe for any other user) it seems critically alarming.
Essentially, my understanding is that if your EJB beans are busy doing something then
EJBs ARE JUST KILLED BY JBOSS ON SHUTDOWN.
They don't have a chance to finish whatever they are doing. I hope that I am doing something stupid because otherwise it is quite scary.
I run JBoss on Win 2000. Results are the same whether I run it as a service or using startup/shutdown scripts. All other JMX stuff seems to shutdown gracefully. EJBs seem to be cleaned gracefully (ejbRemove is called) as well IF THEY ARE NOT BUSY. Problem appears to happen if EJB is doing something - and this is a worst case scenario because it means that you just can't stop server without of risk to corrupt data.
Does anyone have any comments?
I forgot to mention that I run JBoss 3.0.4.
data commits are driven by transactions so there won't be corrupt data in the database
Yep, probably data will be not corrupted.
But what about hanging connections to database that have requests which are neither commited nor rolled back?
When such request is done as update on the existing record and Java App is killed then this record is locked by Oracle.
There are plenty of other unpleasant things that my happen on ungracefull kill. Sure JBOss can do better than kil the bean.
Database connections are managed by the connection pools, not by the container directly, and will shut down as you shut down the server, just like all your other MBeans. In the worst case scenario where a connection is left lingering, it will eventually time out (and even this should not happen, as you see your all mbeans succesfully shut down).
You're thinking the EJB container is this big monolith that is in charge of all the resources in the server, and killing it is a bad thing -- it is not. It is merely an in-memory object of the bean state itself. You could wait for all the beans to finish but then there are issues such as when to forcibly kill a deadlocked beans for instance.
Since shutdown is not an operation you frequently execute on a production system I don't see this as a big issue as there is no data corruption.