First of all, many thanks for this fine answer.

Take a look at the points I mention above:

>
> > My question is two fold:
> >
> > 1- First of all, how can I get a DuplicateKeyException instead of an
> > EJBException?
>
> I don't known any solution. I explain ....
> In case of entity with container-managed persistence, the problem
> is to have the code of the container independant of the type
> of the DataBase (Oracle, InstantDB, ...).
> Indeed, to day, the 'error code' of the java.sql.SQLException
> is database vendor specific, and so we are not able to know if
> the SQLException throwed by the insert SQL statement corresponds to
> a 'DuplicateKeyException' or to any others problems.

Well, it is what I understood. Moreover, the generated code reflect this
problem. Do you think that, in the future, the jdbc spec will be enhanced to
meet this requirement? I don't think so, but who knows?

>
> That's why, the container always throws the EJBException !!
>
> >
> > 2- How can I get rid of the stack trace of the java.sql.SQLException
that
> > JONAS prints? I tried to change the setting of the jonas.properties file
so
> > that the jonas.trace.level  parameter is set to none. No effect at all!
I
> > still have this dirty stack trace.
> >
>
> This trace is done to be EJB specification compliant !!
> Indeed, in the 'Exception handling' chapter of the EJB
> specification 1.1, specify that the container have to log the
> exception or error so that the System Administration is alerted
> of the problem.
>

The solution might be to use the jonas trace instead of a rude stack trace.
By the way, is there any documentation on the code used for the trace. I
noticed that codes range from DB_0 to DB_31 but I have no understanding of
the meaning. I took a look at the generated documentation but there is an
obvious lack of documentation.


> I'm sorry not having constructive reply.
>
> Kind regards.
> H�l�ne.
> --
> -=- H�l�ne JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>   mailto:[EMAIL PROTECTED]    http://www-frec.bull.com
>   Phone: 33.4.76.29.73.53          Fax: 33.4.76.29.76.00
>  Download our EJB Server JOnAS at http://www.bullsoft.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".
>

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

Reply via email to