There's a similar scene in "For Whom the Bell Tolls" by Ernest Hemingway.
I think this is basically the final scene from "The Bridge on the River Kwai" movie as well