0 Replies Latest reply on Apr 10, 2003 5:26 AM by giulio.rossato

    CMP ejb throws RollbackException

    giulio.rossato

      We're working on our application using JBoss 3.0.2 and the CMP persistant Engine.
      Our server-side application is made up of a Session EJB using Entity Beans to update database data, on remote client
      requests.
      We have noticed that when a DB error occurs (for example an SQL error), causing the transaction to be rolled back,
      JBoss throws internally an EJBException incapsulating the SQLException, but at the end the remote client receives a
      javax.transaction.RollbackException instead of a javax.transaction.TransactionRolledBackException.
      We feel that JBoss 3.0.4 is breaking Sun EJB 2.0 Specifications: on a transaction rollback, the Container should throw a
      javax.transaction.TransactionRolledBackException to a remote client (see section 18.3.1). Since this
      exception extends RemoteException, the EJB Remote Interface declares (and can throw!) such exception, despite
      of RolledBackException that extends Exception so it can't be thrown by the remote Interface. The consequences is that
      RMI incapsulates the RollbackException in a java.lang.reflect.UndeclaredThrowableException that is not
      normally caught by a Client: accordingly to Sun it should only expect a RemoteException.
      Is it a known problem? Many other containers respect this specification, so we can't code our client catching a reflection
      exception only to work with JBoss: we want to code a full J2EE compliant client.
      Is it possible to solve it in future releases to make JBoss fullfill this Sun EJB 2.x specification (section 18.3.1)?
      Thanks