@ComponentProfile(summary="Capture data from the message and store it in a database", tag="service,jdbc", recommended=DatabaseConnection.class) public class JdbcBatchingDataCaptureService extends JdbcIteratingDataCaptureServiceImpl
There is probably little or no point in having batches if your underlying database connection has auto-commit=true
. No
checks on the underling Connection
so if DatabaseMetaData.supportsBatchUpdates()
is likely to
return false, then results may be undefined.
With a setBatchWindow(Integer)
of 1, then it will be functionally equivalent to JdbcDataCaptureService
.
If the DocumentBuilderFactoryBuilder
has been explicitly set to be not namespace aware and the document does in fact
contain namespaces, then Saxon can cause merry havoc in the sense that //NonNamespaceXpath
doesn't work if the document
has namespaces in it. We have included a shim so that behaviour can be toggled based on what you have configured.
XPath.newXPathInstance(DocumentBuilderFactoryBuilder, NamespaceContext)
,
JdbcDataCaptureService
In the adapter configuration file this class is aliased as jdbc-batching-data-capture-service which is the preferred alternative to the fully qualified classname when building your configuration.
JdbcDataCaptureServiceImpl.DatabaseActor
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_BATCH_WINDOW |
actor
log
CONFIRMATION_ID_KEY
Constructor and Description |
---|
JdbcBatchingDataCaptureService() |
JdbcBatchingDataCaptureService(java.lang.String statement) |
Modifier and Type | Method and Description |
---|---|
protected long |
executeUpdate(java.sql.PreparedStatement insert) |
protected long |
finishUpdate(java.sql.PreparedStatement insert) |
java.lang.Integer |
getBatchWindow() |
protected static long |
rowsUpdated(int[] rc) |
void |
setBatchWindow(java.lang.Integer i)
Set the batch window for operations.
|
doService, getIterates, getIterationXpath, getNamespaceContext, getXmlDocumentFactoryConfig, initJdbcService, setIterates, setIterationXpath, setNamespaceContext, setXmlDocumentFactoryConfig
closeJdbcService, configureActor, getRowsUpdatedMetadataKey, getSaveReturnedKeys, getSaveReturnedKeysColumn, getSaveReturnedKeysTable, getStatement, prepareService, saveKeys, saveReturnedKeys, setRowsUpdatedMetadataKey, setSaveReturnedKeys, setSaveReturnedKeysColumn, setSaveReturnedKeysTable, setStatement, startService, stopService, updateMetadata
addStatementParameter, getParameterApplicator, getStatementParameters, setParameterApplicator, setStatementParameters
applyTimeout, closeService, commit, createStatement, getConnection, getConnection, getStatementTimeout, initService, prepare, prepareStatement, prepareStatement, rollback, setConnection, setStatementTimeout, start, stop
changeState, close, continueOnFailure, createName, createQualifier, getContinueOnFail, getIsConfirmation, getIsTrackingEndpoint, getLookupName, getUniqueId, init, isBranching, isConfirmation, isTrackingEndpoint, requestClose, requestInit, requestStart, requestStop, rethrowServiceException, retrieveComponentState, setContinueOnFail, setIsConfirmation, setIsTrackingEndpoint, setLookupName, setUniqueId
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
continueOnFailure, isBranching, setUniqueId
createName, createQualifier, isConfirmation, isTrackingEndpoint
changeState, requestClose, requestInit, requestStart, requestStop, retrieveComponentState
getUniqueId
close, init
getLookupName
public static final int DEFAULT_BATCH_WINDOW
public JdbcBatchingDataCaptureService()
public JdbcBatchingDataCaptureService(java.lang.String statement)
protected long executeUpdate(java.sql.PreparedStatement insert) throws java.sql.SQLException
executeUpdate
in class JdbcIteratingDataCaptureServiceImpl
java.sql.SQLException
protected long finishUpdate(java.sql.PreparedStatement insert) throws java.sql.SQLException
finishUpdate
in class JdbcIteratingDataCaptureServiceImpl
java.sql.SQLException
public java.lang.Integer getBatchWindow()
public void setBatchWindow(java.lang.Integer i)
i
- the batchWindow to set; default is 1024 if not specified.protected static long rowsUpdated(int[] rc) throws java.sql.SQLException
java.sql.SQLException