• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Bear Bibeault
  • Knute Snortum
  • Liutauras Vilda
  • Tim Cooke
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Tim Moores
  • Frits Walraven
  • Ron McLeod
  • Ganesh Patekar
  • salvin francis
  • Tim Holloway
  • Carey Brown
  • Stephan van Hulst

SLQ INSERT with JPA transaction not working  RSS feed

Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Netbeans 8.2
TomEE 7.1.0
EclipseLink JPA 2.1
MySQL Database

I'm developing a JavaEE Webapplication with JSF, and have problems with some native queries.
One of our database tables has a Java Entitiy Class generated by netbeans JPA wizard.
Also a controller and a facade.

Displaying data via SQL Select is working - here our method from the controller.

But when I try a CREATE (SQL INSERT) with a transaction, nothing is written into database and no error is displayed in the server log.
I have no idea, why it is not working.
Here our (not working) method from the controller:

It seems to "hang" in the entityManager.getTransaction().begin() method, but not sure.

Any ideas?
Posts: 3797
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Add some logging in there so you can see where it's going from your logs.
Blueberry pie is best when it is firm and you can hold in your hand. Smell it. And smell this tiny ad:
RavenDB is an Open Source NoSQL Database that’s fully transactional (ACID) across your database
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!