Added a new exception when trying to retrieve a PreparedStatement out of context. refs #454