removed 
em.getTransaction().commit();//pridane
        em.getTransaction().begin();
added
em.getTransaction().commit();//pridane
        em.getTransaction().begin();