[jboss-user] [JBoss Seam] - Re: Unable to catch exception in remove method

markfoerstein do-not-reply at jboss.com
Mon Apr 23 14:05:41 EDT 2007


"jpviragine" wrote : Hi, I'm unable to catch exceptions in remove method (SLSB):
  | 
  | public void remove(T entity) {
  |   | 		try {
  |   | 			entityManager.remove(entity);
  |   | 		} catch (Exception e) {
  |   | 			log.error("Error!");
  |   | 		}
  |   | 	}
  | 
  | 
  | The class/method that invoke the above code never appears in stack trace.
  | 
  | Any idea?
  | 
  | Thanks,
  | 
  | Joao Paulo

Hi Joao, Im brazilian too.

The problem is that you're not flushing the entity manager. This is discussed in another topic. There's no way you can catch that exception without flushing the entity manager.

Take a look at this topic, maybe it should help you:
http://www.jboss.com/index.html?module=bb&op=viewtopic&t=100188&postdays=0&postorder=asc&start=10

See posts starting from April, 12.

And search the forum for "entiyManager.flush" or something. You should find what you need.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4039966#4039966

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4039966



More information about the jboss-user mailing list