Search in sources :

Example 11 with RMStoreException

use of org.apache.cxf.ws.rm.persistence.RMStoreException in project cxf by apache.

the class RMTxStore method createDestinationSequence.

// RMStore interface
public void createDestinationSequence(DestinationSequence seq) {
    String sequenceIdentifier = seq.getIdentifier().getValue();
    String endpointIdentifier = seq.getEndpointIdentifier();
    String protocolVersion = encodeProtocolVersion(seq.getProtocol());
    if (LOG.isLoggable(Level.FINE)) {
        LOG.info("Creating destination sequence: " + sequenceIdentifier + ", (endpoint: " + endpointIdentifier + ")");
    }
    Connection con = verifyConnection();
    PreparedStatement stmt = null;
    SQLException conex = null;
    try {
        beginTransaction();
        stmt = getStatement(con, CREATE_DEST_SEQUENCE_STMT_STR);
        stmt.setString(1, sequenceIdentifier);
        String addr = seq.getAcksTo().getAddress().getValue();
        stmt.setString(2, addr);
        stmt.setString(3, endpointIdentifier);
        stmt.setString(4, protocolVersion);
        stmt.execute();
        commit(con);
    } catch (SQLException ex) {
        abort(con);
        conex = ex;
        throw new RMStoreException(ex);
    } finally {
        releaseResources(stmt, null);
        updateConnectionState(con, conex);
    }
}
Also used : RMStoreException(org.apache.cxf.ws.rm.persistence.RMStoreException) SQLException(java.sql.SQLException) Connection(java.sql.Connection) PreparedStatement(java.sql.PreparedStatement)

Aggregations

SQLException (java.sql.SQLException)11 RMStoreException (org.apache.cxf.ws.rm.persistence.RMStoreException)11 Connection (java.sql.Connection)8 PreparedStatement (java.sql.PreparedStatement)6 Identifier (org.apache.cxf.ws.rm.v200702.Identifier)4 IOException (java.io.IOException)3 Test (org.junit.Test)3 Date (java.util.Date)2 SourceSequence (org.apache.cxf.ws.rm.SourceSequence)2 Blob (java.sql.Blob)1 ResultSet (java.sql.ResultSet)1 ArrayList (java.util.ArrayList)1 Message (org.apache.cxf.common.i18n.Message)1 CachedOutputStream (org.apache.cxf.io.CachedOutputStream)1 EndpointReferenceType (org.apache.cxf.ws.addressing.EndpointReferenceType)1 DestinationSequence (org.apache.cxf.ws.rm.DestinationSequence)1 RMMessage (org.apache.cxf.ws.rm.persistence.RMMessage)1