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".

Reply via email to