Fixes "session is closed" when using named query.
Discard parameters that are not specified in JP QL when executing named query.