Hi,
I'm using CMP entity beans.
In my ejb-jar.xml I use:
<assembly-descriptor>
<container-transaction>
<method>
<ejb-name>Initiaal</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
</assembly-descriptor>
in my bean I have the following code
public void update(.....) throws RemoteException, ActionException{
if(lockindicator != getLockindicator()) throw new ActionException("data.changed.by.other.user");
setLockindicator(lockindicator +1);
setData(.....);
}
public void setData(...) throws ActionException{
if("".equals(name)) throw new ActionException("name.requered");
this.setName(...);
this.setDate(...);
}
when I update a record from my servlet I use the update method, with some parameters. When my name is empty I receive an exception. But the problem is that my lockindicator isn't rolled back. He increased with 1.
My question is if the transaction works only for one method. Or is the transaction "multi-method".
Thx in adv.
Pieter