It’s the kind of thing you see in a movie, but not the kind of thing you expect to actually happen in real life.

A Boston-area real estate developer will spend the next two years in federal prison after being convicted of insider trading based on a surreptitiously obtained tip that a bank was about to be acquired.

According to the U.S. Attorney’s Office for the District of Massachusetts, Robert Bray, 78, engaged in insider trading by buying and subsequently selling shares of Wainwright Bank & Trust Company, which was traded on the Nasdaq Stock Market prior to being acquired.

Bray, the owner of R&B Construction, a construction and real estate development company, was convicted in January on one count of securities fraud.

According to evidence presented during Bray’s trial, in 2010, Bray met a friend, an executive at Boston-based Eastern Bank Corp., for drinks at the bar of a Watertown country club where both men are members.

During their meeting, the Eastern Bank executive passed Bray a napkin. Written on the napkin was a tip that Wainwright was about to be acquired – information that Bray acquired more than two weeks before the deal became public.

Bray ultimately used the tip to trade Wainwright shares for a profit of approximately $300,000, which Bray must forfeit as part of his sentence.

According to the U.S. Attorney’s Office, Bray must forfeit a total of $1 million in addition to his two-year sentence.