my dog learned polymorphism*
The moose likes Object Relational Mapping and the fly likes JPA problem! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JPA problem!" Watch "JPA problem!" New topic
Author

JPA problem!

Zaeed McColin
Ranch Hand

Joined: Jan 13, 2009
Posts: 90
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


Open source
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

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

Joined: Jan 13, 2009
Posts: 90
sure, line 20
Zaeed McColin
Ranch Hand

Joined: Jan 13, 2009
Posts: 90
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
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JPA problem!
 
Similar Threads
Html <Head><Title> not showing the title
JPA problem
about sendRedirect
Web App HashMap Serilization
Problems creating WAR file