Peter Kovacs wrote:
>
> Hi,
>
> CreateException thrown in ejbCreate does not find its way to the bean's
> client. Instead, the client
> gets the following exception:
> //-BEGIN
> java.rmi.ServerException: RemoteException occurred in server thread;
> nested exception is:
> java.rmi.RemoteException: Container cannot commit a transaction;
> nested exception is:
> javax.transaction.RollbackException
> //-END
>
Hi Peter,
In fact the exception catched in the client depends on following
factors:
transaction attributes and persistence (explicit or implicit).
In the following I describe the current behavior with JOnAS.
1) with a BMP Bean:
1-1 the create method runs with an unspecified transaction context
(this case may happen with NotSupported, Never and Supports
attributes):
In this case the client receives the CreateException
1-2 the create method runs in the context of the caller's transaction
(this case may happen with Required, Mandatory or Supports):
In this case the client receives the CreateException
1-3 the create method runs in the context of a transaction that the
Container started
immediately before calling the ejbCreate method
this case may happen with Required and RequiresNew attributes):
In this case the client receives:
java.rmi.RemoteException: Container cannot commit a transaction; nested
exception is:
javax.transaction.RollbackException
this is what you have, and I agree that it is not conform to the
spec.
The problem is that at this time we have not found a solution to
rethrow the application exception CreateException to the client,
it is still
an open bug.
2) with a CMP bean:
in all the previous cases the client receives javax.ejb.EJBException
because
there is no standard way to test if a SQLException raised by a given
JDBC driver
correspond to the exception unique key constraint violation.
we have to solve the problem 1-3 in a next version of JOnAS
best regards,
--
Philippe
Philippe Coq Evidian Phone: (33) 04 76 29 78 49
Bull S.A - 1 rue de Provence - 38432 Echirolles Cedex France
Download our EJBServer at http://www.objectweb.org
----
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".