com.avaje.ebean
Interface TxRunnable


public interface TxRunnable

Execute a TxRunnable in a Transaction scope.

Use this with the Ebean.execute(TxRunnable) method.

See also TxCallable.

 
 // this run method runs in a transaction scope 
 // which by default is TxScope.REQUIRED
 
 Ebean.execute(new TxRunnable() {
        public void run() {
                User u1 = Ebean.find(User.class, 1);
                User u2 = Ebean.find(User.class, 2);
 
                u1.setName("u1 mod");
                u2.setName("u2 mod");
 
                Ebean.save(u1);
                Ebean.save(u2);
        }
 });
 

See Also:
TxCallable

Method Summary
 void run()
          Run the method in a transaction sope.
 

Method Detail

run

void run()
Run the method in a transaction sope.



Copyright © 2010. All Rights Reserved.