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

Reply via email to