It is possible for one partner to infect the other by having sex while they have a UTI.
As a common infectious disease in urology, urethritis requires a clear identification of the causative agent at the time of consultation. If the pathogen is gonococcus, then it is gonococcal urethritis, and its main mode of transmission is sexual contact.
If the pathogen is Chlamydia trachomatis, Mycoplasma mycoplasma, Trichomonas, etc., it is nongonococcal urethritis, which can be transmitted from one partner to the other if the partner still has sex during the disease.
All UTIs that are found to be present, and after a definitive diagnosis, often need to be avoided sexually. Sexual partners also need to be checked for UTIs and both should be treated together to avoid recurrent infections.