יְהוָ֣ה אֱלֹהִ֔ים אַל־תָּשֵׁ֖ב פְּנֵ֣י מְשִׁיחֶ֑יךָ זָכְרָ֕ה לְחַֽסְדֵ֖י דָּוִ֥יד עַבְדֶּֽךָ׃ (פ)
HERR, Gott, wende das Antlitz Deines Gesalbten nicht ab. Erinnere dich an die guten Taten von David, deinem Diener.'
Or HaChaim
Another reason why the Torah wrote אחרי מות is connected with the prohibition for Aaron to enter the Holy of Holies dressed in his golden garments (Rosh Hashanah 26) as the accuser (reminder of the gold of the golden calf) could not function as counsel for defense at the same time. The Torah was concerned that we might reason that the prohibition to wear his golden garments was applicable only as long as the last vestiges of Aaron's sin had not yet been erased in the celestial regions. I might have thought that as soon as his sons died and had thereby achieved atonement for their father's remaining vestiges of sin, Aaron would be allowed into the Holy of Holies even while wearing his golden garments. The Torah had to tell us that even after the deaths of his two sons Aaron could still not wear his golden garments in the Holy of Holies. All he was to wear when entering that part of the Sanctuary was כתנת בד קדש ילבש, "a holy linen tunic, etc." While it is true that our sages in Erchin 16 mention that the golden garments performed a function in the atonement process, the gold could not atone sufficiently for the sins to become completely "snow white." Please read what I have written in my commentary on Shabbat 30 what Solomon had in mind when he said "remember the kindness of David Your servant" (Chronicles II 6,42). [I have not seen the author's comment, but I presume that although David had tried to obtain forgiveness by all the means at his disposal, it was not until the prayer of his son Solomon that G'd erased the last vestiges of his sin. The Talmud is on record that the gates of the Sanctuary had refused to open for Solomon until he completed this prayer. Ed.]
Rashi
Who already died. Before the evil inclination overpowered them to push them back from the Holy One, Blessed Is He,4Alternatively, I am able to determine the praise of those who died [ושבח אני את המתים], by observing the conduct and type of life style of their children who are alive [מן החיים]. (Yalkot Eliezer) like the early Patriarchs,5Rashi answers the apparent contradiction between this verse which praises the dead and below [9:4]. Koheles states “for a live dog is better than a dead lion.” (Sifsei Chachomim) for Moshe was answered only through them [i.e., their merit].6See Maseches Shabbos 30a. Moshe said many prayers and God did not answer, but when he mentioned the merit of the Patriarchs in his prayers, he was immediately answered. (Sifsei Chachomim) And like my father Dovid, for I was not answered with twenty-four praises7See Maseches Shabbos 30a. The Gemara there relates that the gates in the Bais Hamikdosh clung to each other when Shlomo attempted to place the Holy Ark into the Kodesh Hakadoshim. He said twenty-four expressions of entreaty and was not answered until he mentioned the kind deeds of Dovid. (Sifsei Chachomim) until I said, “Remember the kind deeds of Your servant Dovid.”8II Divrei Hayomim 6:42.
Rashi
[You] gates, lift your heads In the days of Solomon his son, when he comes to bring the Ark into the Holy of Holies and the gates cling to each other, he [Solomon] recited twenty-four praises, but he was not answered until he said (II Chron. 6:42): “Do not turn back the face of Your anointed; remember the kind deeds of David, Your servant.”
Rashi
and let my enemies see the sign and be ashamed. But the Holy One, blessed be He, did not listen to him to grant the sign during his lifetime. Instead, [it came] in his son Solomon’s lifetime when the gates clung to each other and did not open until he said (II Chron. 6:42): “Do not turn back the face of Your anointed; remember the kind deeds of David Your servant.”