[jboss-user] [JBoss Seam] - Transactional Method Flush
DiegoCoronel
do-not-reply at jboss.com
Wed Dec 19 14:27:52 EST 2007
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
More information about the jboss-user
mailing list