5.7.7 Real-Time Large-Object Columns
Large-object data types require additional considerations when creating a real-time Data Provisioning Adapter.
When a changed record gets pushed to a Data Provisioning Adapter, the data for all subscribed columns are sent.
A possible exception to this behavior is when one of the columns is a large object (BLOB, CLOB, or NCLOB data
type). These columns sometimes contain too much data to be sent in a single call. If so, the large-object data
won't be sent with the changed record.
When receiving a changed record, the adapter must check the data type of each column to determine if it’s a large
object type and verify whether data was sent for those columns. If there are one or more large object columns
without data, the adapter must call the Row.setColumnLobIdValue(int columnIndex, long lobId) or
Row.setColumnLobIdValue(int columnIndex, long logId, LobCharset charSet) method to notify
the Data Provisioning Server that the column is a LOB and that its data needs to be fetched from the remote
source. The lobId value being passed to the Row.setColumnLobIdValue() method must identify the column and
the row for which data needs to be retrieved from the remote source. The Data Provisioning Server will provide
this value later when invoking the
getLob() method of the adapter. If the large object column is NCLOB, you
must use the Row.setColumnLobIdValue(int columnIndex, long logId, LobCharset charSet)
method because it also indicates the encoding applied to the data, which is required for internal processing.
When the changed record is sent to the Data Provisioning Server using the
ReceiverConnection.sendRowSet(RowSet) method, the server determines whether there are any large-
object columns for which data must be retrieved from the remote source. If there are, the adapter getLob(long
lobId, byte[] bytes, int bufferSize) method will be invoked as many times as necessary to get all of
the data. The lobId parameter provided in the getLob() method is the same as what the adapter provided when
calling Row.setColumnLobIdValue(int columnIndex, long lobId) or
Row.setColumnLobIdValue(int columnIndex, long logId, LobCharset charSet), and it must
contain a value that can be used to identify the row and column for which data must be retrieved from the remote
source. The byte array parameter is empty and must be completed by the adapter, but it can’t contain more bytes
than indicated by the bufferSize parameter.
5.8 Enterprise Semantic Services API Support
Enterprise Semantic Services lets business users identify a data's source by providing an array of information
about the object.
SAP HANA includes the following built-in procedures:
● GET_REMOTE_SOURCE_OBJECTS_LIST
● GET_REMOTE_SOURCE_TABLE_DEFINITIONS
● GET_REMOTE_SOURCE_TABLE_ESS_DEFINITIONS
Adapters can support Enterprise Semantic Services by calling these procedures. For example, by calling
GET_REMOTE_SOURCE_TABLE_DEFINITIONS with a defined remote source name and remote table name(s), a
user can easily get detailed information about tables, columns, descriptions, primary keys, foreign keys, and so
on. These procedures can also provide information not available in regular tables like table properties, column
properties, and Enterprise Semantic Services definitions. Therefore, as an adapter developer, it is useful to
provide as much information as possible about the tables for example using importMetadata(). These
36
P U B L I C
Adapter SDK Guide
Building an Adapter by Extending the AdapterCDC