if (isLdapUser) {
EntityManager em = PersistenceManager.getEntityManager();
EntityTransaction tx = em.getTransaction();
try {
tx.begin();
Publisher publisher = em.find(Publisher.class, authorizedName);
if (publisher == null) {
logger.warn("Publisher was not found, adding the publisher in on the fly.");
publisher = new Publisher();
publisher.setAuthorizedName(authorizedName);
publisher.setIsAdmin("false");
publisher.setIsEnabled("true");
publisher.setMaxBindingsPerService(199);
publisher.setMaxBusinesses(100);
publisher.setMaxServicesPerBusiness(100);
publisher.setMaxTmodels(100);
publisher.setPublisherName("Unknown");
em.persist(publisher);
tx.commit();
}
} finally {
if (tx.isActive()) {