The Chasam Sofer (droshos 8th Tamuz) writes about a war in the year 1809 with no causalities on our side.
Can anyone tell us which war this was, and where these details may be recorded?
This is a reference to the Siege of Pressburg, also known as the Siege of Bratislava, in 1809, which was a little over a month-long Napoleonic campaign that ultimately failed (on Napoleon's part). I haven't been able to find much general information (external to the Chatam Sofer's writings) online on the subject, other than it took place sometime during the summer, but here are pictures of a reenactment (besides the videos in the first link). The Chatam Sofer described the siege (and other events in the Napoleonic Wars) in his book Sefer Zikaron (from pg. 11 onwards).
In Sefer Zikaron, the Chatam Sofer wrote that around the 20th of Sivan, a wagon from the town of Jurgen came to evacuate him from the city. He originally planned to leave at the behest of his family and also because he had had many dreams in which he saw himself escape the city, but ultimately stayed in the city because the people of the community begged him to stay. Around this time, most of the women and children, at least of the Jewish community, had been evacuated to other towns. Later, when the siege relaxed somewhat, the Chatam Sofer and his family left for Jurgen. And then, during his stay in Jurgen, he wrote:
"בליליא נגהי ליום ד' אדר"ח תמוז שבו מים הזידונים לאיתנם הראשון, והתחיל לזרוק אבני בליסטראות יום יום פעם שעה או שתים ביום ובלילה והומתו נפשות אינם נימולים אבל תהל"י ברחוב יהודים לא הי' הפסד כלל...גם ראינו כי אין החיצים דולקים ובפרט זכות קהלתנו נראה ברור..."
Translation: "In the dark night of the the 4th of Tammuz the dark waters returned to their original strength, and began to throw boulders daily, sometime for an hour or two in the day and the night, and uncircumcised people were killed but thank Hashem, in the street of the Jews there wasn't a single loss...we also saw that the arrows didn't strike and specifically the merit of our congregation was clear..."
As clarified in Sefer Zikaron, it's not that nobody was harmed, it's that the Jews of Pressburg were unharmed.
It's worthy to note that it is recorded that Jews of Pressburg in general were in fact harmed and even killed during the 1808-09 Napoleonic Campaign against the Austrian Empire, as it says here, so this was a particularly special event.
After the celebration of the miraculous events that transpired until the 8th of Tammuz, which is when the Chatam Sofer gave his Drush (also recorded in Sefer Zikaron), the French returned and once again bombarded the city. This time, at least one Jew was gravely injured. However, while large parts of the city burned, the Jewish quarter was only harmed by arrows:
"...ובתוך כך נודע לנו כי לא הי' שום אש ברחוב יודים רק בשאר מקומות שבעיר, אך החיצים הזיקו כמה אלפים בתי יודים ג"כ, אבל לא הדליק האש..."
Translation: "...And during that time we heard that there was no fire in the street of the Jews, only in other parts of the city, but the arrows1 damaged several thousands of Jewish homes as well, but the fire didn't burn them..."
Finally, on Tuesday, the 13th of Tammuz, the French retreated:
"ביום ג' י"ג תמוז שקטו ונחו האויבים והרימו נס דגל לבן המורה חסד ורחמים..." (pg. 30)
Translation: "On Tuesday, the 13th of Tammuz, the enemy quieted down and raised the white flag of charity and grace..."