occello wrote:
> 
> Well,
> 
> Suppose I have the following code :
> interface Foo extend EJBObject {
>     void toto(int i) throws Exception;
> 
> class FooBean implements EntityBean {
>     public void toto(int i) throws Exception {
>          try {
>              utx.begin();
>              < code >
>              utx.commit();
>            } catch (Exception e) {
>                 rollback();
>                 throw e;
>          }
>     }
> }
> 
> class Client {
>      public void bar(Vector v, String name) throws Exception {
>           try {
>              utx.begin();
>                 Foo foo = home.findByPrimaryKey(name);
>                for (int i = 0; .....)  foo.toto(v.get(i));
>                 < some code >
>            } catch (Exception e) {
>                 rollback();
>                 throw e;
>           }
>       }
> }
> 
> Then if I execute something like
> 
> Client c = new Client();
> c.bar(numbers, name);
> 
> what does happened if toto is always committed in the loop but then an
> exception occured in the code following the loop?
> 

First of all an entiy bean must always be designed with
container-managed
transaction demarcation.
Now, if I transpose your example with Session bean
When a client invokes a business method  Jonas suspends any transaction
that may be
associated with the client request (as specified in EJB1.1 �11.6.1)
So with your code,if toto is always committed in the loop 
but an exception occurs in the code following the loop, only the client
transaction will be rolled back.
regards,

-- 
        Philippe

Philippe Coq  Evidian   Phone: (33) 04 76 29 78 49
Bull S.A  - 1 rue de Provence - 38432 Echirolles Cedex France
Download our EJBServer at http://www.objectweb.org
----
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