Works a treat. Thanks for your help. The modified code (for anybody whose
interested) is:

 public BusinessUnit addUnitAndComponents(BusinessUnitProps props, HashMap
compToDateRa){
       BusinessUnit unit = null;
       try{
            unit = buHome.create(props);   
          
            Iterator iter = compToDateRa.keySet().iterator();
            while(iter.hasNext()){
                BusinessComponent component =
(BusinessComponent)iter.next();
                java.util.Date [] dateRa = (java.util.Date
[])compToDateRa.get(component);
                unit.addComponent(component, dateRa);
            }
        }catch(Exception e){
                throw new EJBException("Creation failed");}
             return unit;
   }

and the transaction attribute for this method is set to 'Required' (the
default for all other methods that this method calls is 'Supports'.

Regards

Robert Hargreaves

-----Original Message-----
From: Jochen Strunk [mailto:[EMAIL PROTECTED]]
Sent: 20 March 2000 17:38
To: Orion-Interest
Subject: RE: Do transactions work at all with Orion?


As CreateException is not a subclass of RuntimeException, you must have 
declared it in your throws clause.
Declaring an exception other than RemoteException in your throws clause 
makes the container treat it as an
application exception, which is defined in chapter 12 of the specification. 
Application exceptions do not rollback
the client transaction.
In your case, the spec suggests throwing an EJBException ( which you don't 
have to declare
in your throws clause because its a subclass of RuntimeException )  that 
wraps the RemoteException.
Then its treated by the container as a non-application exception and the 
transaction should be rolled back automatically.

Hope that helps ( ...and is correct ;-) ).

--jochen

Reply via email to