Some people create a state object for their bean state, e.g. CustomerState.
This can contain some methods that the client can use to do validation.
Then add a method to your bean:

    void update(CustomerState newState);

It also saves on round-trips to the server.

Avi Kivity wrote:
>
> One of the tasks of a GUI is the validation of user input. The most basic
> validation is the input field size. Validation can be performed by
> attempting to store the data and catching any exceptions, or by limiting the
> input field size at the GUI level (which is, of course, preferred).
>
> However, the standard client->SB->CMP EB->RDBMS model offers no support for
> that:
>
> - the exception model does not work: the container is allowed to delay the
> database write until the end of the transaction, which means that the
> exception occurs *after* all bean instance methods have returned. This
> leaves the client with the nasty job of extracting the SQLException from the
> RemoteException, parsing the vendor-specific message, mapping from the
> database schema to the object level (that was the point of CMP, wasn't it?),
> and finally recovering the beans which have been deleted due to the
> RemoteException thrown.
>
> - there is no support at the EB level to query the field sizes. Even if I
> were to do this through JDBC, storing global values in EBs is not permitted.
> Even if I knew the field sizes, they would probably be in bytes, not
> characters.
>
> Any way out?
>
> - Avi
> --
> s/\be(\w+)/e-\1/g;
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

--
________________________________________________________________________________

Evan Ireland              Sybase EAServer Engineering        [EMAIL PROTECTED]
                            Wellington, New Zealand               +64 4 934-5856

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to