At 11:47 16.03.2000 +0000, you wrote:
>Dear All,
>
>I am using Orion 0.9.1.
>I have a method in a Sesion bean with transaction attribute set to
>
><trans-attribute>RequiresNew</trans-attribute>
>
>The conatiner manages the transactions .The method looks like this:
>
>public void addUnitAndComponents(BusinessUnitProps props,
> HashMap compToDateRa) throws
>RemoteException{
> // first create the new unit and then for each item
> // in the hashmap add the component
> // The HashMap contains BusinessComponent : Date []
>
> try{
> BusinessUnit 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 RemoteException(e.toString());}
> }
>
>I get an exception thrown at
>
>unit.addComponent(component, dateRa);
>
>so therefore I expect the call to buHome.create(props) (which creates an
>entity bean) to be rolled back. But it isn't.
>
>This looks very similar to
>http://www.mail-archive.com/orion-interest@orionserver.com/msg00622.html
>to which there was no reponse at all.
>
>Is this a bug?
No, its not. Same mistake we made.
Look at the spec, 12.1.2. Your example should work if you throw a runtime
exception that is
not declared in the throws clause of your method (e.g. EJBException)
instead of the RemoteException, otherwise you have to take care of the
rollback yourself.
--jochen strunk
(-) Jochen Strunk
(-) SIGNAL 7 Gesellschaft für Informationstechnologie mbH
(-) Brüder-Knauß-Str. 79 - 64285 Darmstadt,
(-) Tel: 06151 665402, Fax: 06151 665373
(-) [EMAIL PROTECTED], www.signal7.de