Is Gallstone Surgery Compulsory For Its Treatment?

Is it necessary to treat gallstones with the help of surgery to avoid recurrent pancreatitis? If yes, what is the most preferred method of gallstone surgical treatment?