What's New in Apama > What’s New in Apama 5.0 > New ADBC adapter features
New ADBC adapter features
In Apama 5.0, the ADBC adapter has been enhanced in a variety of areas. For complete up-to-date information, see "Using the Apama Database Connection" in Deploying and Managing Apama Applications.
General API improvements
In earlier releases, the settings for _ADBCTable when storing events or data and _ADBCTime when storing events were specified in an action's extraParams parameter. With release 5.0 you now use the tableName parameter when storing events and data and the timeColumn parameter when storing events to specify this information. This change affects the following ADBC actions:
*Connection.storeEvent
*Connection.storeEventWithAck
*Connection.storeData
*Connection.storeDataWithAck
*Connection.storeDataWithAckId
In earlier releases, the settings for _ADBCType and _ADBCTime when running playback queries were specified in the extraParams parameter. With release 5.0, you use the following setter actions to specify this information:
*Query.setEventType
*Query.setTimeColumn
Note: The setter actions are not necessary when using the ADBC Sim adapter for playback.
The seldom used uniqueConnection parameter is now specified in the extraParams in the following action:
*Connection.openDatabaseFull
The following actions now return an integer id. This makes them consistent with the commitRequest actions.
*Connection.rollbackRequest
*Connection.rollbackRequestFull
Token parameter added
In release 5.0, a new string token parameter has been added to selected actions and callbacks to permit matching in the callback. This allows the callback to perform different operations depending on the token value. This eliminates the need to create different callbacks. The following actions use the token parameter.
*Connection.storeEventWithAck
*Connection.storeDataWithAck
*Connection.storeDataWithAckId
*Connection.commitRequestFull
*Connection.runCommand
*Connection.runCommandFull
*Query.setBatchDoneCallback
*Query.setResultEventCallback
The following new actions have been added for use with the token parameter:
*Query.getQueryResultToken
*Query.getBatchDoneToken
New playback action
The following action has been added for running playback queries:
*Query.setRunUntilTime
A SQL statement can be specified for store actions
With ADBC store operations, you can now use either a provided SQL statement or the generated statement. The SQL statement provided can perform an insert or update and the use of a stored procedure is supported.
*Connection.storeEvent
*Connection.storeEventWithAck
*Connection.storeData
*Connection.storeDataWithAck
*Connection.storeDataWithAckId
The following actions have been added to create and delete storeStatements used with the above actions
*Connection.createStoreStatement
*Connection.deleteStoreStatement
New FixedSizeInsertBuffers property
The FixedSizeInsertBuffers is a new property that allows you to change the default buffer size used when the StoreData and StoreEvent actions perform batch inserts. The property is specific to ODBC. Apama uses the FixedSizeInsertBuffers property to specify the size of the buffers for the columns. The default "true" uses a fixed buffer size of 10K bytes for each column. If the value is changed to "false", the size of the column buffers is determined dynamically by examining the database table into which the data will be inserted. Allowing the buffer size to be set dynamically can significantly reduce memory usage when performing batch inserts to database tables that contain hundreds of columns or when using a very large StoreBatchSize.
Database connections can be opened in read-only mode
A parameter has been added to specify that a database connection should be opened in read-only mode. When a connection is opened in read-only mode an error will be reported for any API action that requires writes (Store, Commit, or Rollback). Most databases do not prevent writes from a connection in read-only mode so it is still possible to perform writes using the Command actions. The adapter will log a message to this effect for connections opened in read-only mode.
The open actions that use the readOnly parameter are:
*com.apama.database.Connection.openFull
*com.apama.database.Connection.openShared
*com.apama.database.DBUtil.open
*com.apama.database.DBUtil.openShared
New open "shared" actions
Both the ADBC Event API and the ADBCHelper API have new open "shared" actions that will use an already open connection if one is found; if the action does not find a matching open connection, it opens a new one. The actions are:
*com.apama.database.DBUtil.openShared is part of the ADBCHelper API
*com.apama.database.Connection.openDatabaseShared is part of the ADBC Event API
New reconnection capability
Apama applications can automatically reconnect if a disconnection error is encountered. The reconnection capability is optional and the default is to not reconnect when a disconnection error occurs. The following reconnection actions are available to control the reconnection behavior.
*action setReconnectPolicy
*action setReconnectTimeout
Copyright © 2013 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or Terracotta Inc., San Francisco, CA, USA, and/or Software AG (Canada) Inc., Cambridge, Ontario, Canada, and/or, Software AG (UK) Ltd., Derby, United Kingdom, and/or Software A.G. (Israel) Ltd., Or-Yehuda, Israel and/or their licensors.