A man sent "a mountain" of text messages to his ex, breaking a court order banning him from contacting her, Lincoln Crown Court was told.
Martin Lewis had previously been given an indefinite ban on making contact with the woman following earlier incidents.
Phil Howes, prosecuting, said: "This was a persistent and relentless contact. He was contacting her by text and on Facebook.
"There was a mountain of texts. They were not of a threatening nature and he talks about relatively mundane things."
Lewis had been given early release from a previous prison sentence but following his arrest he was recalled to complete his sentence.
Lewis, 33, formerly of Chatterton Avenue, Lincoln, admitted breach of a restraining order in September 2012. He was jailed for two years.
Judge Michael Heath told him: "You have breached orders persistently.
"They seem to have no effect whatsoever.
"On this occasion this was an unrelenting barrage of text messages from you to this woman. The only sentence I can pass is a custodial sentence.
"If you continue you will receive higher and higher sentences up to the maximum."
Ian Groom, defending, said that Lewis accepted he faced a prison sentence.