I've come across the following problem after upgrading to ehcache-1.2.4:
http://sourceforge.net/forum/forum.php?thread_id=1624868&forum_id=322278
While the cause of the problem seems to be a race condition between the EHCache and JBoss JVM shutdown hooks, I'm wondering if the exception handling in SessionFactoryImpl.close might not be a little fragile.
It seems that Exceptions thrown from the CacheProvider closing/destroying isn't being caught, causing the ConnectionProvider not to be closed.
Please let me know if this warrants a JIRA issue.
Thanks,
Frank