Hi friends,
when I try to store some Data in Database I get this error:
Unable to create requested service [org.hibernate.engine.transaction.spi.TransactionFactory] How can I solve this problem. I am using MongoDb as Database and HibernateOGM. here zou can find mz block of code:
Code:
OgmConfiguration cfgogm=new OgmConfiguration();
cfgogm.configure("hibernate.cfg.xml");
serviceregistry=new ServiceRegistryBuilder().applySettings(cfgogm.getProperties()).buildServiceRegistry();
sessionfactory=cfgogm.buildSessionFactory(serviceregistry);
Session session=sessionfactory.getCurrentSession();
session.beginTransaction();
Contact cnt=new Contact();
cnt.setEmail("bbb@gmail.com");
cnt.setFirstname("bowi");
cnt.setLastname("bowia");
session.persist(cnt);
session.flush();
session.getTransaction().commit();
System.out.println("Done...");
thank you for your helps