-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: NetBeans 5.5 and Hibernate
PostPosted: Fri Oct 27, 2006 5:41 pm 
Newbie

Joined: Thu Mar 09, 2006 8:16 am
Posts: 13
dear community,

I have generated JSF pages from existing entities, using NetBeans 5.5
,Hibernate-3.2.0,cr4 Hibernate-entitymanager-3.2.0.cr2 .In JSF table I can see my result sets from my table debts
in PostgreSQL 8.1 database ,but when I try to edit them
or try to delete them I receive message in my browser
that " debts are successfully deleted" or "debts are successfully
updated". No errors, no exceptions,no errorneous logs in my Sun Application Server 9.

Problem is that my database remains untouched!!

I can't figure out is it a NetBeans problem or is it something with
hibernate.One user asked me:"do I use transactions?".

Generated code is starting a transaction and committing it.
Please let me know is this have a something with my "bug".
here is the code using transactions.

...

Code:
@Resource
private UserTransaction utx;

@PersistenceUnit(unitName = "HibenateAppPU")
private EntityManagerFactory emf;

private EntityManager getEntityManager() {
return emf.createEntityManager();
}

public String destroy() {

EntityManager em = getEntityManager();

try {
utx.begin();
Debts debts = getDebtsFromRequestParam();
debts = em.merge(debts);
em.remove(debts);
utx.commit();
addSuccessMessage("Debts was successfully deleted.");

}
catch (Exception ex) {

try {
addErrorMessage(ex.getLocalizedMessage());
utx.rollback();
} catch (Exception e) {
addErrorMessage(e.getLocalizedMessage());
}

}

em.close();
return "debts_list";
}

...


Any help is appreciated

best regards
Nikola

_________________
nikola_croatia


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.