tx-control/tx-control-api/src/main/java/org/osgi/service/transaction/control/TransactionBuilder.java
@SafeVarargs
	public final TransactionBuilder noRollbackFor(Class< ? extends Throwable> t,
			Class< ? extends Throwable>... throwables) {

		Objects.requireNonNull(t,
				"The supplied exception types must be non Null");
		for (Class< ? extends Throwable> t2 : throwables) {
			Objects.requireNonNull(t2,
					"The supplied exception types must be non-null");
		}
		noRollbackFor.clear();
		noRollbackFor.add(t);
		noRollbackFor.addAll(Arrays.asList(throwables));
		return this;
	}
/**
	 * Declare a list of Exception types (and their subtypes) that
	 * <em>must not</em> trigger a rollback. By default the transaction will
	 * rollback for all {@link Exception}s. If an Exception type is registered
	 * using this method then that type and its subtypes will <em>not</em>
	 * trigger rollback. If the same type is registered using both
	 * {@link #rollbackFor(Class, Class...)} and
	 * {@link #noRollbackFor(Class, Class...)} then the transaction
	 * <em>will not</em> begin and will instead throw a
	 * {@link TransactionException}
	 * <p>
	 * Note that the behaviour of this method differs from Java EE and Spring in
	 * two ways:
	 * <ul>
	 * <li>In Java EE and Spring transaction management checked exceptions are
	 * considered "normal returns" and do not trigger rollback. Using an
	 * Exception as a normal return value is considered a <em>bad</em> design
	 * practice. In addition this means that checked Exceptions such as
	 * java.sql.SQLException do not trigger rollback by default. This, in turn,
	 * leads to implementation mistakes that break the transactional behaviour
	 * of applications.</li>
	 * <li>In Java EE it is legal to specify the same Exception type in
	 * {@link #rollbackFor} and {@link #noRollbackFor}. Stating that the same
	 * Exception should both trigger <em>and</em> not trigger rollback is a
	 * logical impossibility, and clearly indicates an API usage error. This API
	 * therefore enforces usage by triggering an exception in this invalid case.
	 * </li>
	 * </ul>
	 * 
	 * @param t An exception type that should not trigger rollback
	 * @param throwables further exception types that should not trigger
	 *            rollback
	 * @return this builder
	 */
Declare a list of Exception types (and their subtypes) that
must not trigger a rollback. By default the transaction will
rollback for all  Exceptions. If an Exception type is registered
using this method then that type and its subtypes will not
trigger rollback. If the same type is registered using both
#rollbackFor(Class, Class...) and
#noRollbackFor(Class, Class...) then the transaction
will not begin and will instead throw a
TransactionException

Note that the behaviour of this method differs from Java EE and Spring in
two ways:

In Java EE and Spring transaction management checked exceptions are
considered "normal returns" and do not trigger rollback. Using an
Exception as a normal return value is considered a bad design
practice. In addition this means that checked Exceptions such as
java.sql.SQLException do not trigger rollback by default. This, in turn,
leads to implementation mistakes that break the transactional behaviour
of applications.
In Java EE it is legal to specify the same Exception type in
#rollbackFor and  #noRollbackFor. Stating that the same
Exception should both trigger and not trigger rollback is a
logical impossibility, and clearly indicates an API usage error. This API
therefore enforces usage by triggering an exception in this invalid case.

@param t An exception type that should not trigger rollback
@param throwables further exception types that should not trigger
rollback
@return this builder
Declare a list of Exception types ( and their subtypes ) that must not trigger a rollback . By default the transaction will rollback for all Exceptions . If an Exception type is registered using this method then that type and its subtypes will not trigger rollback . If the same type is registered using both #rollbackFor ( Class Class ... ) and #noRollbackFor ( Class Class ... ) then the transaction will not begin and will instead throw a TransactionException Note that the behaviour of this method differs from Java EE and Spring in two ways : In Java EE and Spring transaction management checked exceptions are considered " normal returns " and do not trigger rollback . Using an Exception as a normal return value is considered a bad design practice . In addition this means that checked Exceptions such as java . sql . SQLException do not trigger rollback by default . This in turn leads to implementation mistakes that break the transactional behaviour of applications . In Java EE it is legal to specify the same Exception type in #rollbackFor and #noRollbackFor . Stating that the same Exception should both trigger and not trigger rollback is a logical impossibility and clearly indicates an API usage error . This API therefore enforces usage by triggering an exception in this invalid case . @param t An exception type that should not trigger rollback @param throwables further exception types that should not trigger rollback @return this builder
@SafeVarargs
	public final TransactionBuilder noRollbackFor(Class< ? extends Throwable> t,
			Class< ? extends Throwable>... throwables) {
		Objects.requireNonNull(t,
				"The supplied exception types must be non Null");
		for (Class< ? extends Throwable> t2 : throwables) {
			Objects.requireNonNull(t2,
					"The supplied exception types must be non-null");
		}
		noRollbackFor.clear();
		noRollbackFor.add(t);
		noRollbackFor.addAll(Arrays.asList(throwables));
		return this;
	}
@ SafeVarargs public final TransactionBuilder noRollbackFor ( Class < ? extends Throwable > t , Class < ? extends Throwable > ... throwables ) { Objects . requireNonNull ( t , "The supplied exception types must be non Null" ) ; for ( Class < ? extends Throwable > t2 : throwables ) { Objects . requireNonNull ( t2 , "The supplied exception types must be non-null" ) ; } noRollbackFor . clear ( ) ; noRollbackFor . add ( t ) ; noRollbackFor . addAll ( Arrays . asList ( throwables ) ) ; return this ; }
Declare a list of Exception types (and their subtypes) that
 <em>must not</em> trigger a rollback.
Declare a list of Exception types ( and their subtypes ) that <em > must not< / em > trigger a rollback .