Even simple delete/insert activities hangs in my hibernate session -


i've coded simple delete statement on client class, calling on dao layer delete row hibernate entity named 'person'. however, on debug, after row getting deleted (before commit), transaction hangs. why?

this persondao deletes person id. can seen, i'm committing transaction, flushing session, closing session properly:

public boolean deleteperson(long personid)  {     boolean issuccessful = false;     transaction tx = null;     try {         session = sessionfactory.opensession();         tx = session.begintransaction();         person p = new person();         object persistentinstance = session.load(person.class, personid);         if (persistentinstance != null) {             ((person)persistentinstance).getresponses().clear();             ((person)persistentinstance).getownedevents().clear();             session.delete(persistentinstance);         }         session.gettransaction().commit();     } catch (exception e) {         tx.rollback();         issuccessful = false;         e.printstacktrace();     } {         session.flush();         session.close();         return issuccessful;     } } enter code here 


Comments

Popular posts from this blog

javascript - Confirm a form & display message if form is valid with JQuery -

Retrieving ETA (estimated time of arrival) with Google Distance Matrix API and public transit as transport mode -

ionic framework - Meteor - Error: Failed to execute 'insertBefore' on 'Node' -