Thus says the Lord, the God of Israel, I anoint you king over the people of the Lord, over Israel. And you shall strike down the house of Ahab your master, so that I may avenge on Jezebel the blood of my servants the prophets, and the blood of all the servants of the Lord. For the whole house of Ahab shall perish, and I will cut off from Ahab every male, bond or free, in Israel. And I will make the house of Ahab like the house of Jeroboam the son of Nebat, and like the house of Baasha the son of Ahijah. And the dogs shall eat Jezebel in the territory of Jezreel, and none shall bury her. [ESV, II Kings 9:6b-8]These are the words of an unnamed prophet to Jehu, the first king in the last dynasty of the northern kingdom of Israel. The prophet instructs Jehu to supplant Ahab's heir and kill of the remaining heirs. Every male of Ahab's house will perish. This isn't just a command. It's a prediction.
The only problem is that Ahab's daughter Athaliah was married to King Jehoram of Judah, and Jehoram's son Ahaziah was also killed off in Jehu's purge as a descendant of Ahab. In fact, all of Jehoram and Ahaziah's children were killed, except Jehoash, who would eventually become the next king of Judah, thus preserving the line of David. But isn't Jehoash a male descendant of Ahab? Do we actually have conflicting prophecies here, one confirming the Davidic dynasty in perpetuity and the other confirming the dying out of Ahab's dynasty? If so, then there's no way they could both be fulfilled, but even one false prophecy disqualifies a prophet. The author of Kings seems to treat this prophecy as fulfilled, however. So what's going on?
It doesn't do to treat the text's author as a bunch of unrelated, ignorant buffoons who edit a text without allowing for quality control enough for the text to be consistent with some of the driving ideology purposes of the very book itself, which would include the 100% reliability of prophecy from genuine prophets. I haven't seen anyone do that in this case, though. (Not to say that I've never seen biblical prophets make that kind of mistake. They often do. I just didn't see anyone doing it here.) Surprisingly, I couldn't find any commentary that raises this issue at all. I looked at several. Someone whose work I didn't look at might have raised it, or maybe one of the commentaries I looked at raises it in a different place (there are other prophecies about this transfer of power and references back to it later on). But it apparently never occurred to any of them that there might be some issue with a prophecy here that seems to conflict with a different one (and indeed seems not to have been fulfilled if taken the way I took it above).
So what might the author or final editors of this text have taken this text to mean if they obviously did think it fulfilled? If Ahab's line was preserved in the very line of David that was prophesied to go on perpetually (and on the Christian view leads to Jesus Christ as great David's greater son), then the prophecy must not mean "every male descendant of Ahab". This expression is literally something like "everyone of Ahab who urinates on the wall", and it's possible but unlikely that it means something else besides "every male of Ahab". Nonetheless, I find those proposals much less likely than just the males of his household. But that's the key, I suspect. Perhaps the males descended from Ahab aren't included among the males of his household that this passage refers to. So Jehoash would then not have been part of the intended end to Ahab's house, since he's not actually of Ahab's house but David's.
So it turns out this isn't that difficult question. It just surprises me that no one whose work I looked at on this verse had even raised it.