I have problem with using EntityManager.persist(Object)
method. Now when i get rid of other problems, by app work without Exception but object is not put in my data
Are you getting a specific exception? It would be helpful to know what it is if you are.
There are a number of similar problems to this already on Stackoverflow:
Spring transactional context doesn't persist data
Spring, Hibernate & JPA: Calling persist on entitymanager does not seem to commit to database
These suggest that you should try adding em.flush()
after the em.persist(chain)
, and altering the @transactional
annotations
You should also check that you have enabled transactional annotations through a line such as :
in your .xml configuration