sf logo

Interface TransactionRunnable<T>

Type Parameters:
T - the type of the result of a call to run. If no result is returned this type should be Void

public interface TransactionRunnable<T>

The TransactionRunnable interface should be implemented for code that needs to be run in a transactional context.

Typical usage is like this:

 TransactionRunnable<Void> runnable = new TransactionRunnable<Void>() {
         public Void run(Connection connection, Object... arguments) throws SQLException {
     List<Person> personList = (List<Person>)arguments[0];
     PreparedStatement ps = connection.prepareStatement("...");
     return null;

See Also:

Method Summary
 T run(Connection connection, Object... arguments)
          This method is called by a SessionRunner.

Method Detail


T run(Connection connection,
      Object... arguments)
      throws SQLException
This method is called by a SessionRunner.

connection - the database connection
arguments - a variable list of arguments
a result
SQLException - thrown if an exception occured. This will force a rollback of the transaction
See Also:

sf logo

Copyright © 2007 brunella ltd. All Rights Reserved.