LVIV, Ukraine — Taras Demlan was out for a quiet drink with friends in the western Ukrainian city of Lviv, a beguiling jewel of Hapsburg architectural splendor, and his companions persuaded him to try the specialty of the house.

A waitress took off his shirt, tethered his hands behind the back of a chair and began dripping molten wax from a burning candle on Mr. Demlan’s chest. Then came a rubdown with ice cubes followed by lashings of a whip across his bare back.

“That,” said Mr. Demlan of his ordeal at Lviv’s Masoch Cafe, “was really uncomfortable.”

Discomfort, however, is exactly what Leopold von Sacher-Masoch, the 19th-century writer from Lviv in whose honor the cafe is named, would have wanted. His best known work, “Venus in Furs,” features lengthy philosophical ruminations on and descriptions of sexual pleasure derived from pain, and led a Viennese professor of psychology, Richard von Krafft-Ebing, to coin the term “masochism” as a description of what he viewed as a deviant clinical condition.

As a gimmick to attract attention, the writer’s legacy would seem unbeatable for a city eager to attract foreign tourists to the western edge of Ukraine, a former Soviet republic better known these days for its political turmoil, struggles with President Vladimir V. Putin’s Kremlin and general post-Communist angst.