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

2007-03-05 Thread krica
I know this is an old thread, but I ran into the same problem with the ValidatorException causing the crash. After much trial and error, this is the solution I have come up with. I thought it may be useful for others, at least once I get the last little niggle out of it, which I don't think is

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

2006-09-13 Thread bfo81
Ok, found out that hosed is it slang and means broken ;). However... @Gavin, could you explain me why using setRollbackOnly() causes isn't good for the PersistenceContext? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971221#3971221 Reply to the post :

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

2006-09-13 Thread [EMAIL PROTECTED]
If a txn rolls back, the EJB3 spec says that the PC should be cleared. So you will lose the state of the PC. View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971307#3971307 Reply to the post :

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

2006-09-13 Thread bfo81
Thanks for your answer. But the PC only exists during editing one single entity (in a conversation), so I think it's ok... it works without problems ;). View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3971324#3971324 Reply to the post :

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

2006-09-09 Thread bfo81
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) |

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

2006-09-08 Thread denis-karpov
1. For simple validation (just value) we can still use JSF validation. 2. For complex validation I use drools (jBoss Rules). It nicely integrated with Seam Page Flow (see seam samples). You can express your validation in rule set. IMHO it looks like quite elegantly. You can define as complex

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

2006-09-08 Thread bfo81
[EMAIL PROTECTED] wrote : There is one problem with performing validation during the action phase: if you are using an extended persistence context, you would prefer to do validation before applying values onto the model object. But by the time we get to the action method, the values have

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

2006-09-08 Thread [EMAIL PROTECTED]
Unfortunately this is not a solution. The EPC is considered hosed after a transaction rollback. The only way (per-spec) is to annotate actionMethod() or the bean as @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED), which is ugly. CVS version of Seam has

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

2006-09-07 Thread CptnKirk
I agree with Gavin. I've always been ok with complex validation in the action method (or control flow). If you need something a little more declarative, it shouldn't be too hard to use Seam plus EJB interceptors to write your thin framework. If you think about it this is what JSF is doing

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

2006-09-07 Thread petemuir
I still think that it is frustrating that JSF validator error messages and action phase validation error messages won't appear at the same time. Any ideas? View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3970183#3970183 Reply to the post :

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

2006-09-07 Thread [EMAIL PROTECTED]
There is one problem with performing validation during the action phase: if you are using an extended persistence context, you would prefer to do validation before applying values onto the model object. But by the time we get to the action method, the values have already been applied. It is

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

2006-09-07 Thread CptnKirk
And required checking happens outside of conversion/validation at yet another time. Unfortunately, JSF seems to be designed to support providing a consistent checked state through each phase of the lifecycle and short circuit phases if there are problems. This almost explicitly designs away

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

2006-09-07 Thread petemuir
I see where you are coming from with validating within the application but IMO the disadvantages are greater * Your entities get updated with invalid values (less of an issue with manual flushing as Gavin says) | * That's what @Invalid did and IIRC it didn't work brilliantly | * As you

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

2006-09-06 Thread [EMAIL PROTECTED]
IMO, it is perfectly reasonable to put complex validations in the action method... View the original post : http://www.jboss.com/index.html?module=bbop=viewtopicp=3969930#3969930 Reply to the post : http://www.jboss.com/index.html?module=bbop=postingmode=replyp=3969930

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

2006-09-01 Thread petemuir
AFAIK the ModelValidator doesn't solve the 'complex' validation case: when you want to validate the value of component x against the value of component y. A simple example of this is that the integers entered into X and Y must add up to 150. View the original post :

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

2006-08-31 Thread bfo81
Well, forget it. There's another problem. That complex validation would work well on an existing person that you edit. But when you create a new person all its properties are null. And when you fill in the fields in a form and click save, then the persons properties are still null during

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

2006-08-31 Thread petemuir
IMO this is a (big) problem with JSF validation - not that the validation framework can only handle 'simple' validation, but that you can't display 'complex' validation errors at the same time as simple ones. I can't see a way around it. I wonder if there has been any disucssion about this on

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

2006-08-31 Thread raja05
bfo81 wrote : | But when you create a new person all its properties are null. And when you fill in the fields in a form and click save, then the persons properties are still null during validation (phase 3). They get their concrete values later, in phase 4 (update model values). And, alas,