I'm running JBoss AS 5.1.0 GA and I'm trying to flush the connection pool.
I haven't been able to find any examples of this particular scenario, but this is what I have come up with from reading online. However, it doesn't work. It makes the call just fine and doesn't throw an exception, but the connection pool doesn't get flushed.
ObjectName objectName = new ObjectName("jboss.jca:name=DefaultDS,service=ManagedConnectionPool");
MBeanServer server = org.jboss.mx.util.MBeanServerLocator.locateJBoss();
server.invoke(objectName, "flush", null, null);
Is this the preferred way to handle this? And does anyone know why it is not working?