Have you tried creating your own Exception classes and have your EJB
methods throw those? That way, your clients will know what kind of
Exception was thrown and will have access to any additional information you
put into the Exception. Validating the input upon entry via your EJB
mutator methods seems like a better way to validate data instead of putting
it off right before the database gets updated. I don't think ejbStore() is
the appropriate place to implement business rules. Business rules should be
implemented in your business methods.
---
Michael R. Maraya
> ----------
> From: Doron Gan[SMTP:[EMAIL PROTECTED]]
> Reply To: [EMAIL PROTECTED]
> Sent: Thursday, July 19, 2001 3:10 PM
> To: Jboss-User
> Subject: [JBoss-user] Question on business validation rules and EJB
> servers in general.
>
> Hi,
>
> So I want my business entity objects to be consistent before they
> are
> commited. I figured this couold be done on the ejbStore() call when a
> transaction is about to be commited. At this time I could check, for
> example, if a string property is too long. If this fails I can
> setRollbackOnly() on the current transaction. The question is, how do I
> communicate the validation error that occured to the user? I.e. the user
> could have called a session bean that did a bunch of object modifications
> and when the transaction commited each of those objects could generate
> validation errors. Right now the client app(user) only gets a transaction
> rollback exception.
>
> Is there some-way to tie an object to the currrent transaction and
> use that
> object to store all the error messages so they can be accessed
> programatically by the user if a transaction failes?
>
>
> -Doron
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user
>
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user