[jboss-user] [JBoss Seam] - Re: Problem: Custom validate methods in EJBs crash

bfo81 do-not-reply at jboss.com
Sat Sep 9 05:31:05 EDT 2006


Gavin, maybe we misunderstood each other. It's important to mention that the actionMethod above shall perform "complex" validation and then save if everything is alright.


  | @Stateful
  | @Scope(CONVERSATION)
  | @Name("whateverEditor")
  | @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
  | public class WhateverEditorBean .... {
  | 
  | ...
  | 
  |     @TransactionAttribute(TransactionAttributeType.REQUIRED)
  |     @End(ifOutcome={"backToListPage"})
  |     public String actionMethod() { 
  | 
  |         if ( ! complexValidationOk() ) {
  |         
  |             ejbCtx.setRollbackOnly();   //no flushing at the end of the method
  |             addFacesMessage("Complex validation failed");
  |             return null;   //redisplay editor page
  |         }
  | 
  |     //everything ok? then auto-flushing will be performed at the end of the method.
  | 
  |         return "backToListPage";
  |     }
  | 
  | ...
  | }

The flush-mode in the begin annotation is much better, yes... but for a non-beta, non-CVS, production environment I need another solution. And I'm really interested what you think about the approach above. For me it seemed to work perfectly. 

btw: what does "hosed" mean? Sorry, I'm German, and the dictionary doesn't know that word *dooooh* ;).


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

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



More information about the jboss-user mailing list