Making sure we execute the query to avoid the defered execution to happen
after the session has been disposed. Closes #1215