Albert Brotzer wrote:
>
> i just wonder how to map SQLExceptions caused by databaserrors to a
> meaningful errormessage for the users.
>
> To be precise:
> - my client invokes a method - say updateFields() - on the session bean.
> (TX_REQUIRED)
> - the sessionbean finds and updates fields of an entity bean. (isModified
> Optimization is used)
> - the updateFields() method is finished and due to TX_REQUIRED the
> transaction is committed and the entitybean is written back to the database.
>
> If an SQLException occurs during the commit of the transaction, all i get
> back on the client is a rather cryptic RolledbackException. I see no
> possibilty to drill down to the causing SQLException and display a useful
> message to the user. (e.g. unique index violation)
>
> How do the experts solve this?
I'm afraid there is no solution to this. The ejb container uses the
standard JTA interface
to communicate with the Transaction Manager. The only way to report the
problem
is : setRollbackOnly() without any parameter.
Moreover, the rollback of the Transaction could have different causes,
so it
could be difficult to report all the raisons for rolling back.
regards,
--
Philippe Durieux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bull - 1 rue de Provence - 38432 Echirolles Cedex France
[EMAIL PROTECTED]
-> Download our EJBServer at http://www.evidian.com/ejb <-
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".