Win a copy of Python Continuous Integration and Delivery this week in the Python forum!
  • 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 ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

SLQ INSERT with JPA transaction not working  RSS feed

 
Greenhorn
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?
 
Rancher
Posts: 3921
45
  • 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.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!