The commit statement does not change the result. You will still get an error ("ORA-00942 table or view does not exist").
I suspect you ran the script with the commit when the view was known in the database. If the view exists the script will succeed with or without the commit.
Use @Maheswaran Ravisankar answer to solve the issue.