CMOS batteries for clock and settings data retention are normally not used when connected to the mains.
This is because even when the computer is turned off, it is not completely disconnected; it is still supplied with standby power, which is used to maintain the clock and to process when the power button is pressed.
When connected to the mains, the battery is automatically disconnected and operates on standby power. (This is an ambiguous term. It is actually similar, but different.)
I would expect it to hold up fine if left alone for 10 years or so, but if it consumes it after less than a year, is the bad motherboard, is the battery of poor quality, or is it a design problem? I wonder.