Example usage for org.springframework.jca.cci.core InteractionCallback doInInteraction

List of usage examples for org.springframework.jca.cci.core InteractionCallback doInInteraction

Introduction

In this page you can find the example usage for org.springframework.jca.cci.core InteractionCallback doInInteraction.

Prototype

@Nullable
T doInInteraction(Interaction interaction, ConnectionFactory connectionFactory)
        throws ResourceException, SQLException, DataAccessException;

Source Link

Document

Gets called by CciTemplate.execute with an active CCI Interaction.

Usage

From source file:org.springframework.jca.cci.core.CciTemplate.java

@Override
@Nullable/*  ww w .jav  a2 s.  c o m*/
public <T> T execute(final InteractionCallback<T> action) throws DataAccessException {
    Assert.notNull(action, "Callback object must not be null");
    return execute((ConnectionCallback<T>) (connection, connectionFactory) -> {
        Interaction interaction = connection.createInteraction();
        try {
            return action.doInInteraction(interaction, connectionFactory);
        } finally {
            closeInteraction(interaction);
        }
    });
}