Hi Samuel,
There was a problem about catching in a client javax.ejb.CreateException
and
javax.ejb.RemoveException exceptions.
This is fix in the JOnAS last version 2.2.7, which is available in
the web site.
Kind regards.
Hélène.
samuel rouiller wrote:
>
> Hi,
>
> I'm developing an entity bean with BMP. In ejbCreate(), I check first if
> there is already a record with the same primary key by executing a select
> statement. If a record is found, I throw a DuplicateKeyException().
>
> My problem is that this exception is not propagated to my client, which
> instead catches a java.rmi.SystemException:
> 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
>
> In the meantime, the EJBServer outputs the following:
> getPrimaryKey -> null
> ejbCreate has failed => abort tx
> EntityContextImpl.abortTransaction
> Rollback during beforeCompletion in SubCoordinator.commit_one_phase
> getPrimaryKey -> null
> JEntityHome.removeEJBObject: pk = null
> Commit local transaction -> rolled back!
>
> The only solution I found so that my client gets the DuplicateKeyException
> is to manage a transaction explicitely in the client using a UserTransaction
> object.
>
> I believe that there is something I don't understand with transactions in
> EJB. Any help will be appreciated.
>
> Kind regards,
> Samuel
>
> ----
> 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".
--
-=- Hélène JOANIN -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
mailto:[EMAIL PROTECTED] http://www.evidian.com
Phone: 33.4.76.29.73.53 Fax: 33.4.76.29.76.00
Download our EJB Server JOnAS 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".