if (exception instanceof RuntimeException)
{
// if we get to here with a RuntimeException, we have a system exception.
// EJB 2.1 section 18.3.1 says we need to discard our instance.
pool.discard(ctx);
}
else
{
// if we get to here with an Exception, we have an application exception.
// EJB 2.1 section 18.3.1 says we can keep the instance. We need to return