/** * Execute a block of code, in the scope of a JDBC transaction. * The connection and all created statements are automatically released. * The transaction is automatically committed, unless an exception occurs. * * @param block Code block to execute * @param application Play application (<tt>play.api.Play.unsafeApplication()</tt>) */ public static void withTransaction(ConnectionRunnable block, Application application) { withTransaction("default", block, application); }
/** * Execute a block of code, in the scope of a JDBC transaction. * The connection and all created statements are automatically released. * The transaction is automatically committed, unless an exception occurs. * * @param block Code block to execute */ public static <A> A withTransaction(ConnectionCallable<A> block) { return withTransaction("default", block); }
/** * Execute a block of code, in the scope of a JDBC transaction. * The connection and all created statements are automatically released. * The transaction is automatically committed, unless an exception occurs. * * @param block Code block to execute */ public static void withTransaction(ConnectionRunnable block) { withTransaction("default", block); }
/** * Execute a block of code, in the scope of a JDBC transaction. * The connection and all created statements are automatically released. * The transaction is automatically committed, unless an exception occurs. * * @param block Code block to execute * @param application Play application (<tt>play.api.Play.unsafeApplication()</tt>) */ public static <A> A withTransaction(ConnectionCallable<A> block, Application application) { return withTransaction("default", block, application); }
/** * Execute a block of code, in the scope of a JDBC transaction. * The connection and all created statements are automatically released. * The transaction is automatically committed, unless an exception occurs. * * @param name Datasource name * @param block Code block to execute */ public static <A> A withTransaction(String name, ConnectionCallable<A> block) { return withTransaction(name, block, play.api.Play.unsafeApplication()); }
/** * Execute a block of code, in the scope of a JDBC transaction. * The connection and all created statements are automatically released. * The transaction is automatically committed, unless an exception occurs. * * @param name Datasource name * @param block Code block to execute */ public static void withTransaction(String name, ConnectionRunnable block) { withTransaction(name, block, play.api.Play.unsafeApplication()); }