Holding on to your urine for a long time is not good for your bladder or the kidneys.
The reason that you may have to go to the toilet every 30 minutes could very well be an infection in the urinary tract. If you have an urge to go after you have been that could also indicate that the prostate gland may be enlarged.
You may have a weak bladder.
Have a salty diet can retain the fluid, and then when you eat properly fluid retention is then released. If you go on a diet that can happen first when the excess body fluid is released. Drinking a lot of coffee could also make you go a lot, because coffee is a diuretic.
Although you do go or have an urge to go very often, it is still important to drink your fluids and especially water. With any urinary infections drinking lots of water is a healthy choice.
If you do encounter the problem again, it is best to make an appointment to see your doctor and take a urine sample with you. If you have no had your prostate gland checked and still are having urinary problems with no infection, then it would be wise to get it examined to make sure it is not enlarged.
Sometimes when we are nervous or anxious that can make us want to empty the bladder a lot and even have urge to urinate when the bladder has been emptied.
Best wishes.