Since we’ve temporarily lost our internal blog and I have a lot of backlogged topics, I’m going to start posting to this site. These will eventually get moved back to our internal site. In the meantime, I’d like to start with this fascinating topic.

Olga called me about a week ago with a problem. Any time she re-published her WAR file to Websphere and re-ran her application she was getting ClassCastExceptions. This did not happen when she stopped and restarted the Websphere server. It didn’t take too much investigation to realize that her app (actually, our framework) was putting custom objects in the cache. On republishing her app those objects were still present in Dynacache. However, the new app used a new instance of the Java class loader and so could not trust any objects previously loaded by another class loader. This is one of those places where the .Net concept of namespace (which includes version number) is really nice. I told Olga she either needed to stop and restart the server or clear the cache. She didn’t like the former idea and had no way of doing the latter. As an experiment, I decided to look into whether or not I could use JMX to complete such a task. It turns out you can. In fact, using JMX you can get a list of every Dynacache instance on your cluster and get at all of the metadata for each entry in the cache. On top of that, you can clear any cache instance with a single API invocation. More on the where-for’s and how-to’s coming up in my next post.

Advertisements