Search the Community
Showing results for tags 'JTA'.
-
hi , im try to do the java web to connect with managed bean and connect to the javaDB (entity) class i trying to insert the record in the database but ....fail.... public void createUser(){ Booking book = new Booking(); book.setLessonno(this.l_id); book.setCustomername(strName); book.setCustomerphone(strPhone); try { utx.begin(); em.persist(book); utx.commit(); } catch (Exception e) { throw new RuntimeException(e); } } this come out a error .... java.lang.UnsupportedOperationException: Not supported yet. public void updateDB(){ EntityManagerFactory emfactory = Persistence.createEntityManagerFactory("testTrainingPU"); EntityManager entitymanager = emfactory.createEntityManager(); entitymanager.getTransaction().begin(); Lesson lesson = entitymanager.find(Lesson.class, this.l_id); lesson.setQuantity(lesson.getQuantity()-1); entitymanager.getTransaction().commit(); Booking book = new Booking(); book.setCustomername(strName); book.setCustomerphone(strPhone); book.setLessonno(this.l_id); entitymanager.persist(book); entitymanager.getTransaction().commit(); entitymanager.close(); emfactory.close(); } this way also same so how i need to solve it ...thanks