BOSTON — Jake Peavy playfully jumped onto David Ortiz outside the batting cage before Wednesday’s game. The former teammates from the 2013 World Series shared a hug and a laugh.

During the game, Boston’s 2016 version of Peavy made his Red Sox debut.

Drew Pomeranz, 27, acquired to stabilize the Boston rotation, pitched three solid innings and got crushed in the fourth – six hits, five runs and zero outs.

What in blazes was Dave Dombrowski thinking?

Actually, Dombrowski’s thought process was sound. And despite whatever hysteria you encounter Thursday from the ever-angsty faithful of Fenway, the trade for Pomeranz makes sense.

Was it a gamble? Most trades are.

Will it still work out? It should.

Now let me ask you a question: Did the Peavy deal work out three years ago?

Back then, Boston traded shortstop wizard Jose Iglesias to Detroit in a three-team deal, receiving Peavy from the White Sox. Boston had Jon Lester and John Lackey, but also rotation questions about productivity (Ryan Dempster and Felix Doubront) and health (Clay Buchholz).

Peavy, then 32, made his Boston debut on Aug. 3, limiting Arizona to four hits and two runs over seven innings.

Red Sox fans rejoiced.

Peavy’s second start: 10 hits and six earned runs over five innings in Kansas City.

Peavy went 4-1 for Boston that year, but he was not spectacular (4.04 ERA) and the Red Sox were 5-5 in his 10 starts. In the postseason he was 0-1 with a 7.09 ERA.

The trade for Peavy worked because he filled a need, and the Red Sox won the World Series.

Enter Pomeranz three years later.

He does not have the experience of Peavy, nor does he appear to be the character that Peavy was (Pomeranz does not bark at himself on the mound).

Pomeranz has not been used a lot as a full-time starter, until this year, but his numbers coming in were solid – 2.47 ERA, and an opponents’ batting average of .184.

To get Pomeranz, Dombrowski had to deal one of Boston’s best pitching prospects in many years – 18-year-old Anderson Espinoza.

Critics bemoaned that Boston was again blowing a chance to develop a homegrown starter. And they wondered if Pomeranz was going to hold up. He came in with a career high 102 innings. And he threw a lot of pitches – 4.14 per plate appearance, third most of any major league starter.

Concerned, John Farrell?

The Boston manager allowed a slight chuckle before Wednesday’s game.

“With Drew, I just want him to go out and pitch,” Farrell said. “Let’s see how it unfolds for us.”

The first inning seemed typical for Pomeranz. He needed 21 pitches to face four batters (one walk).

In the second, Pomeranz mixed his fastball and curve well. He struck out Mac Williamson swinging on a 92 mph fastball. Against Trevor Brown, Pomeranz threw three straight curves and then froze him with a fastball for strike three.

In the third, Pomeranz struck out two more. He had allowed a baserunner in each inning, but looked in control.

Pomeranz had to wait a long time to pitch the fourth because of Boston’s five-run bottom of the third. But that can’t be an excuse for what happened.

Pomeranz gave up a leadoff walk and then six straight hits – including homers by Williamson and Brown. Robbie Ross could not warm up fast enough.

Pomeranz left the mound and you could hear boos.

But he has had tough outings before (41/3 innings against these Giants on April 25, six earned runs by Arizona on May 29) and showed he can bounce back. In his last start against San Francisco, he pitched seven shutout innings.

Pomeranz had a bad night Wednesday. For what it’s worth, so did Espinoza in his debut in the Midwest League. He lasted only three innings, giving up four runs in the third.

Padres fans might be wondering why their team traded Pomeranz.

All trades are a gamble. This one should still work out for Boston.