Session code cleanup and client side statement pooling