Transactions in Ebean

Implicit Transactions

When there is no current transaction you can still execute a query, save or delete a bean etc.

When this happens Ebean will create an implicit transaction and commit it (or rollback if there was a failure).

// execute a query without an existing transaction...
// ... a "implicit" transaction will be created
// ... and be commited (or rolled back) for you
List<User> users = 
			Ebean.find(User.class)
				.join("customer")
				.where().eq("state", UserState.ACTIVE)
				.findList();

// execute a save without an existing transaction...
// ... will create an implicit transaction 
// ... and be commited (or rolled back) for you
Ebean.save(user);
Introduction User Guide (pdf) Install/Configure Public JavaDoc Whitepapers
General Database Specific Byte Code Deployment Annotations Features
Top Bugs Top Enhancements
woResponse