hi folks, I'm new in JSF I developed a JSF application,
application is about a small library
okay, admin users can add new book to system(DB)
I do it with a method in a managed bean, but
some problems are here
the bookAdd.jsp page (it's Okay)
and related managed bean (the problem specify with [x])
everything works okay, except addBook() method, id doesn't add any new record with JPA, or throws any exception, also it works till [x]
:record(s) can not add to DB
:this operation doesn't work(process)
*without any new record(s) or changes in database
*web server doesn't throw any exception
My guess is that your transaction commit process isn't correct, but I don't do anything that's remotely like what you're doing.
First of all, I'm using DTO/Service classes to handle the persistence rather than attempting to jam everything into the backing bean.
Secondly, I use Spring to manage the DTO/Service instances. Spring can automatically provide the transaction management as well as the grunt work of cleaning up exceptions and stuff like that. And Spring and JSF play together quite well.
While I use more classes to get the work done, the individual classes are all simpler, since they only attempt to accomplish one thing, and they're enough like related classes in the same tier that it makes for easier maintenance and testing.
Some people, when well-known sources tell them that fire will burn them, don't put their hands in the fire.
Some people, being skeptical, will put their hands in the fire, get burned, and learn not to put their hands in the fire.
And some people, believing that they know better than well-known sources, will claim it's a lie, put their hands in the fire, and continue to scream it's a lie even as their hands burn down to charred stumps.
posted 11 years ago
wow, i solved it,
I just change my provider "OpenJPA" and use
and it works Okay
also thank you Mr. Holloway, I'd like to see an example of your solution
We should throw him a surprise party. It will cheer him up. We can use this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop