Hey, how can i make a method flush when it runs with success.

I have managed Bean

  | @Name("cadastroFornecedoresBean")
  | @Scope(ScopeType.SESSION)
  | public class CadastroFornecedoresBean {
  |     @In(create = true, value = "#{almoxarifadoFacade}")
  |     private IAlmoxarifadoFacade almoxarifadoFacade;
  | .
  | .
  | .
  | try {
  |                     almoxarifadoFacade.persistFornecedor(fornecedor);
  |                     resultList = new ArrayList<Fornecedor>();
  |                     fornecedor = new Fornecedor();
  |                     
facesMessages.addFromResourceBundle(FacesMessage.SEVERITY_INFO, 
"#{msg.SUCESSO}");
  |             }
  |             catch (Exception e){
  |                     //How to get the exception ?
  |             }
  |     
  | 

my facade


  | @Name("almoxarifadoFacade")
  | public class AlmoxarifadoFacade implements IAlmoxarifadoFacade {
  | .
  | .
  | .
  | @Transactional
  |     public void persistFornecedor(Fornecedor fornecedor) {
  |             em.persist(fornecedor);
  |     }
  | 

so.. if my persist throw any exception my managed bean isnt getting it..  the 
entityManager flush after my managed bean method, how can i do to my facade 
auto flush when the method finish ??

Sry about my english.

Ty

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

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4114369
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to