When Solomon built the Temple, he sought to bring the Ark into the Holy of Holies. The gates clung to each other. Solomon recited twenty-four songs of praise, and he was not answered. He began and said: “Lift up your heads, O gates, and be lifted up, you everlasting doors, that the King of glory may come in”
(Ps. 24:7). They ran after him to swallow him; they said: “Who is this King of glory?” He said to them: “The Lord, strong and mighty”
(Ps. 24:8). He said again: “Lift up your heads, O gates, lift them up, you everlasting doors, that the King of glory may come in. Who is this King of glory? The Lord of hosts, He is the King of glory, Selah”
(Ps. 24:9–10), and he was not answered. When he said: “O Lord God, turn not away the face of Your anointed; remember the kindnesses of David Your servant”
(2 Chron. 6:42), he was immediately answered. At that moment the faces of all David’s enemies turned
[black] like the bottom of a pot, and all the people and all Israel knew that the Holy One, Blessed be He, had forgiven him for that sin. Did not Solomon speak well: “So I praised the dead who have already died”?
כשבנה שלמה את בית המקדש ביקש להכניס ארון לבית קדשי הקדשים דבקו שערים זה בזה אמר שלמה עשרים וארבעה רננות ולא נענה פתח ואמר (תהלים כד, ז) שאו שערים ראשיכם והנשאו פתחי עולם ויבא מלך הכבוד רהטו בתריה למיבלעיה אמרו מי הוא זה מלך הכבוד אמר להו ה' עזוז וגבור חזר ואמר (תהלים כד, ט) שאו שערים ראשיכם ושאו פתחי עולם ויבא מלך הכבוד מי הוא זה מלך הכבוד ה' צבאות הוא מלך הכבוד סלה ולא נענה כיון שאמר (דברי הימים ב ו, מב) ה' אלהים אל תשב פני משיחך זכרה לחסדי דוד עבדך מיד נענה באותה שעה נהפכו פני כל שונאי דוד כשולי קדירה וידעו כל העם וכל ישראל שמחל לו הקב"ה על אותו עון ולא יפה אמר שלמה ושבח אני את המתים שכבר מתו