There is a flush operation on the pool in JMX.
This will close all connections in the pool
and close any curently checked out connections when they are
returned to the pool.
I'm not sure whether JBoss is using MysqlConnectionPoolDataSource, but if it is (or did), and you're using Connector/J 3.1.x (the feature I'm about to mention is implemented in the source tree, and available in nightly snapshots from http://downloads.mysql.com/snapshots.php), when you call getConnection() on the pooled connection, the entire MySQL server-side state (including temp-tables and session variables) is reset.
If you can get to the underlying 'mysql' JDBC connection from JBoss's connection pool wrappers, you could do the same by calling the 'resetServerState()' method.