This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Agile forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA problem!

 
Zaeed McColin
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi folks,
I try to add do a transaction with JPA by a Servlet
but system doesn't throw any exception, also I don't have any changes in the database
please help
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you step through the code with the debugger? Does any line of code cause an exit?

Perhaps you need to save each author first, and then the book. Can you save the book without specifying an author? I know it doesn't make sense, but just from a testing perspective, maybe you can see if that works. Can you just save an author alone?

Nothing in the log files? Have you been able to persist anything to this table? So, do you have a simple example where you can go to this database and save just one, simple record? Is it working in other instances, but just not this one?

Just digging for ideas...

-Cameron Mckenzie
 
Zaeed McColin
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sure, line 20
 
Zaeed McColin
Ranch Hand
Posts: 90
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
wow, i solved it,
I just change my provider "OpenJPA" and use

instead of

and it works Okay
@Mr. McKenzie: yes I did all of them, test without setAuthors(), check the logs, it was amazing, without any exception, error, update or something like that
thanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic