public void contextDestroyed(ServletContextEvent sce) {
		/* stop JPA/hibernate */
		EntityManagerFactory factory = (EntityManagerFactory) sce.getServletContext().getAttribute(EntityManagerFactory.class.getName());
		if(factory != null) {
			try {
				factory.close();
				sce.getServletContext().removeAttribute(EntityManagerFactory.class.getName());
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
		
		/* stop database */
		HsqldbManager dbmanager = (HsqldbManager) sce.getServletContext().getAttribute(HsqldbManager.class.getName());
		if(dbmanager != null) {
			try {
				dbmanager.stop();
				sce.getServletContext().removeAttribute(HsqldbManager.class.getName());
			} catch (Exception e) {
				e.printStackTrace();
			}
		}
	}