According to Wikipedia, Glock pistols are indeed semi-automatic. Apparently any single-chambered, single-barrelled pistol is semi-automatic, and the gun Beckett had in this episode clearly wasn't a revolver, so there you go.
I Googled for "Glock underwater," and apparently firing one underwater will irreversibly damage the barrel due to the hydraulic pressure, the gun will probably jam quickly if it doesn't blow up in your hand, and the shock wave could damage your ears, eyes, or internal organs. Since Castle and Beckett were in an enclosed space when several shots went off, they should probably have died from organ damage. (There is a version of the Glock 17 that can be modified for underwater use, but Beckett apparently uses a 19 now.)