Beset by hard-to-keep promises and a massive website failure, President Barack Obama traveled to the heart of the “Obamacare” opposition Wednesday to give a pep talk to the law’s supporters.

Ad-libbing at a synagogue in Dallas, Obama said he was the first to admit he was unhappy with the rocky first month since new insurance exchanges went live. He implored volunteers and guides who are working to help consumers to stick with it, casting it as an effort that would, eventually, be well worth the trouble.

“As challenging as this may seem sometimes, as frustrating as HealthCare.gov may be sometimes, we are going to get his done,” Obama said.

“And when we do — when we do, not if — when we do, you’re going to have families all across this great state of Texas who are going to have the security and the well-being of high-quality, affordable health insurance,” he added.

The trip to Texas comes as his administration seeks to mitigate the damage from the website glitches and from a public outcry about a promise he repeatedly made — if you like your insurance, you can keep it — that turned out to be incorrect for millions of Americans.

Before leaving Washington on Wednesday, Obama tried to soothe the concerns of 16 Senate Democrats facing re-election next year during a two-hour White House meeting. Many of those lawmakers are worried that the problem-plagued rollout could negatively affect their races.

Highlighting the law’s benefits at Dallas Temple Emanu-El, Obama encouraged participation in the marketplaces set up by the law. He said nothing drives him crazier than knowing there’s good insurance available — if only the website would work properly.

“This is like having a really good product in a store, and the cash registers don’t work, and there aren’t enough parking spots,” Obama said.

The visit also cast a bright light on staunch opposition to the law in Republican-leaning Texas, which has the highest rate of uninsured Americans — more than 23 percent. GOP Gov. Rick Perry has refused to take advantage of a provision in the law to expand Medicaid to cover more of the working poor.

Obama said Texas’ neighbors had looked at the Medicaid expansion, which is fully funded by the federal government for the first few years, as a no-brainer.

“I know that sometimes this task is especially challenging here in the great Lone Star State,” Obama said to laughter. “But I think all of you understand that there’s no state that actually needs this more than Texas.”

Perry shot back, accusing Obama in a statement of trying to “salvage his ill-conceived and unpopular program from a Titanic fate.”

“Texans aren’t the reason Obamacare is crumbling,” Perry said. “Obamacare is the reason Obamacare is crumbling.”

Texas also is among the 36 states not providing their own insurance marketplaces, which means residents there must sign up through the federal website that stumbled badly upon its launch Oct. 1.

Before leaving Dallas, Obama also planned to attend two fundraisers for the Democratic Senatorial Campaign Committee.

Back in Washington, Health and Human Services Secretary Kathleen Sebelius faced heated questioning from senators, some of whom challenged her honesty and demanded she resign.

Obama has been aggressively promoting the law in the face of numerous setbacks. In addition to the problem-plagued enrollment launch, insurers have been sending some of their customers termination notices because their policies don’t meet federal requirements.

The notices have put Obama and White House officials on the defensive as they attempt to explain Obama’s early vow that under the new law, people who like their existing coverage would be allowed to keep it.