Flatman, capped eight times by England, joined Bath from Saracens in 2003, but his Recreation Ground career was hampered by injury problems until he regained full fitness midway through the current campaign.
"Hopefully now the bad times are behind me. You cannot thrive on negative feelings, so you have to look to the future," he said.
"I am feeling very positive and I believe that I am now opening a new chapter in my rugby career."
Bath coach Brian Ashton added: "David has already played at international level, and I have no doubt that had he not sustained his Achilles tendon injury he would have already played on many more occasions for England."