Addison makes the great Stoic say—It is often said, because it is often said and with no better basis, like every other halfwit urban legend, that the melancholy and pessimism and "Long Defeat" attitude found in Tolkien, is Christian. But...no it's not. It's pagan. It is found in Tolkien's models, but they were mostly Anglo-Saxon bards who'd learned a bunch of pagan poetry and noticed that Wotan's doomed struggles are an awesome literary theme. In the most Christian of European romances you do not find that element, you only find it when they're consciously aping a pagan model. Hence it's found in the Romantics, who lamented the "Enlightenment" entirely in favor of the Renaissance (e.g. their theory of monarchy, which is purely that of the Dominate era of Rome—if you suggested "divine right of kings" to the medievals they'd probably kill you for blasphemy)."'Tis not in mortals to command success;But the spirit of Romance and Christendom, the spirit which is in every lover, the spirit which has bestridden the earth with European adventure, is quite opposite. 'Tis not in mortals to deserve success. But we'll do more, Sempronius; we'll obtain it.
But we'll do more, Sempronius, we'll deserve it."
—G. K. Chesterton, What's Wrong with the World
The attitude is pagan, Stoic and Norse and oh by the way Buddhist, that dissatisfaction about the impermanence of things is kinda two of the three marks of existence that are only the, y' know, essence of Buddhism. The Christian attitude is different. Before Christendom lost its nerve in stupid nostalgia for the Roman Empire, the attitude in its literature was entirely the opposite of that fatalistic, all-enduring resignation; it was a solid tissue of defiance of "fate" from one end to the other. E.g., De Troyes's "Érec et Énide" is generally considered to derive from Aeneas and Dido. Only instead of getting abandoned and killing herself while swearing an enmity that causes one of their civilizations to be destroyed, Enid frees captives, saves her husband's life several times, and becomes a queen. And every time she saves her husband's life? She does it by disobeying his orders. Just a bit different.
That quitter Romanticism crap is far more the quasi-paganism of the Sandalpunk Era ("classicism" has good connotations which are undeserved by "let's turn off our brains for 200 years, and just do Greco-Roman cosplay instead") than the Christianity of the Middle Ages.
Seriously, 12th-century Europeans were not yet brokenhearted from their failure to defend the East, and had not yet lived through the plague or destroyed themselves with the Reformation Wars; they just had the fairest social system, the best hygiene, the greatest architecture, the most productive agriculture, and the most advanced manufacturing in the history of the world. They were the first to abolish slavery, recognize the legal adulthood of women, or attempt to curtail war atrocities. Hence why their literature lacked any melancholy deriving from their own failures: they were still succeeding.
You might say that their later heartbreak showed they were naïve. But their whole breakdown was caused by losing their nerve, and deliberately reverting to their previous way of doing things. The melancholy in Tolkien is Romanticist, that is, born of a movement jaded from the Renaissance, Reformation, and Revolutions. None of those things would ever have happened if not for the resurrection of Roman Law; even the Plague could've been withstood, if Philip the Fair hadn't seen an advantage, during a succession dispute, to resurrecting Iron Age patriarchy and the Dominate-era theory of the executive.
Some of the modern West has a similar optimism, to which Tolkien's Norse Stoicism is contrasted, despite the fact his is the less authentically Christian attitude—though the moderns mostly come by it through being a sham Gospel (not to say what Buddhists would call a false refuge). We abolished slavery very late in our own territories, and abet it to this day elsewhere; women were essentially minors in our laws well into the 20th century (till the late 1980s in Switzerland); while the medievals failed to protect the East, we failed to protect it a thousand times more (the Soviets did far worse to Eastern Europe and Central Asia in four generations than the Ottoman Turks did in twenty-four). Again, the Crusades, which are supposed to show the brutality of the medievals, killed 1.5 million people, over 300 years; the quintessential war of our era killed 70 million people over 6. The medievals may have been naïve to think their culture was a basis for optimism; but if they were, we are much more naïve (specifically, 275 timesnote).
I close as I opened, with a quote from What's Wrong with the World, quite possibly the most famous quote from it and one of Chesterton's most famous quotes period.
Mankind has not passed through the Middle Ages. Rather mankind has retreated from the Middle Ages in reaction and rout. The Christian ideal has not been tried and found wanting. It has been found difficult; and left untried.