public static void closeCache() { try { if (cache != null && !cache.isClosed()) { cache.close(); } } catch (Exception e) { e.printStackTrace(); } try { if (ds != null) ds.disconnect(); } catch (Exception e) { getLogWriter().fine("Error in disconnecting from Distributed System"); } }