Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Object Relational Mapping
Search Coderanch
Advance search
Google search
Register / Login
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
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Tim Cooke
Campbell Ritchie
paul wheaton
Ron McLeod
Devaka Cooray
Sheriffs:
Jeanne Boyarsky
Liutauras Vilda
Paul Clapham
Saloon Keepers:
Tim Holloway
Carey Brown
Piet Souris
Bartenders:
Forum:
Object Relational Mapping
JSF(managed) bean can not remove record
Jason Marlyn
Ranch Hand
Posts: 90
posted 15 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
hi folks
following code should remove a record from DB, but it doesn't
public void delIt(ActionEvent act){EntityManager EM=EMF.createEntityManager(); try{ boolean grant=FacesContext.getCurrentInstance().getApplication().createValueBinding("#{user.access}").getValue(FacesContext.getCurrentInstance()).equals(true); if(!grant){FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Access is denied"));return;} _PBeans.books tm=EM.find(_PBeans.books.class, this.value); if(tm!=null){EM.getTransaction().begin(); EM.remove(tm); EM.getTransaction().commit();this.thisBook=new _PBeans.books(); FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("book removed successfully "+tm.getName()+tm.getId()+"\\"));return;} //[0] FacesContext.getCurrentInstance().addMessage(null, new FacesMessage("Error")); }catch(Exception e){throw new FacesException("an error occured details: "+e);}finally{EM.close();} }
System can not compile the line [0], no exception, no error, no message, no change in the DB
provider: OpenJPA
Open source
Did you see how Paul
cut 87% off of his electric heat bill with 82 watts of micro heaters
?
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
suppress ConverterException messages from displaying in browser
JSF(managed) beans, can not work with JPA
f:selectitems issue in jsf
HTML in FacesMessage?
Setting Messages
More...