ibi Patterns .NET API
Loading...
Searching...
No Matches
NetricsServerInterface.NetricsTransaction Class Reference

This is an interface object associated with an explicit transaction. More...

Public Member Functions

long getTransactionId ()
 Returns the transaction id of the associated transaction.
 
int getTranId ()
 Obsolete. Use getTransactionId to obtain the full 64-bit id.
 
bool getClosed ()
 Returns whether the associated transaction is closed.
 
void commitWork ()
 Commit the associated transaction.
 
void forceCommitWork ()
 Forcibly commit the associated transaction.
 
void abortWork ()
 Abort the associated transaction.
 
- Public Member Functions inherited from NetricsServerInterface.NetricsServerInterface
 NetricsServerInterface (String host, int port)
 
 NetricsServerInterface (String host, int port, int encodingNum)
 
 NetricsServerInterface (String host, int port, bool debug)
 Set debug to true to print socket output to stdout.
 
bool DebuggingOn ()
 Turn on socket protocol debugging output.
 
bool DebuggingOff ()
 Turn off socket protocol debugging output.
 
void selectLayout (String layout)
 Obsolete. Layouts are deprecated since version 5.6, and removed in 5.7. This function has no effect.
 
String getLayout ()
 Obsolete. Layouts are deprecated since version 5.6, and removed in 5.7. This function always returns null.
 
bool ParseDebuggingOn ()
 Turn on response parsing debugging output.
 
bool ParseDebuggingOff ()
 Turn off response parsing debugging output.
 
ConnectionPoolingPolicy getConnectionPoolingPolicy ()
 Get the current connection pooling policy.
Default is ConnectionPoolingPolicy.Shared.
 
void setConnectionPoolingPolicy (ConnectionPoolingPolicy policy)
 Changes the connection pooling policy for this NetricsServerInterface object.
Use of this function is not generally recommended.
 
NetricsTableStats tblload (NetricsTable tbl)
 Used to load a NetricsTable into the server.
 
NetricsTableStats tblload (NetricsTable tbl, bool doMaxWork)
 Used to load a NetricsTable into the server.
 
NetricsTableStats tblload (NetricsTable tbl, NetricsRecFile fileDef)
 Create and load a table from a server side CSV file.
 
NetricsTableStats addRecsFromFile (String tblName, bool replaceNotAdd, NetricsRecFile fileDef)
 Add or replace records from a file.
 
NetricsTableStats updRecsFromFile (String tblName, NetricsRecFile fileDef)
 Update records from a server side file.
 
void thcreate (NetricsThesaurus thes)
 Create a thesaurus in the ibi™ Patterns - Search Server.
 
void cthcreate (NetricsCombinedThesaurus cthes)
 Create a combined thesaurus in the ibi™ Patterns - Search Server.
 
void cmapcreate (NetricsCharmap cmap)
 Create a character map in the ibi™ Patterns - Search Server.
 
String[] cmaplist ()
 Lists the character maps currently loaded in the ibi™ Patterns - Search Server.
 
NetricsCharmap cmapget (String name)
 Gets the content of a character-map.
 
NetricsCharmapStats[] cmap_stats (String[] cmap_names)
 Lists statistics on character maps currently loaded on the server.
 
void wdcreate (NetricsWeightedDictionary wdict)
 Create a weighted dictionary in the ibi™ Patterns - Search Server.
 
void rlcreate (String rlModelName, String rlModelFile)
 Create a learning engine model in the server.
 
void rlcreate_l (String rlModelName, String rlModelFile, bool allowLargeGatewayMem)
 Create a learning engine model in the server.
 
void rlcreate_l (String rlModelName, String rlModelFile)
 Like rlcreate_l(rlModelName, rlModelFile, bool), except the gateway model-in-memory flag is left at the server default (currently false).
 
NetricsModelStats[] rllist (String[] modellist)
 List information on ibi™ Patterns - Search Learn Models.
 
void rldelete (String[] modellist)
 Delete one or more ibi™ Patterns - Search Learn Models.
 
double rleval (String rlModelName, double[] featurevec)
 Evaluate an ibi™ Patterns - Search Learn Model with the given vector of feature values.
 
NetricsSearchResponse search (NetricsSearchCfg cfg, NetricsSearchOpts opts)
 Version of search to search a single table.
 
NetricsSearchResponse search (NetricsSearchCfg[] tblCfgs, NetricsSearchOpts opts)
 Perform a search.
 
NetricsSearchResponse scoreRecords (NetricsQuery query, NetricsSearchOpts query_opts, NetricsTable rec_format, params NetricsRecord[] records)
 Score one or more records against a query.
 
NetricsSearchResponse scoreRecords (NetricsQuery query, NetricsSearchOpts query_opts, NetricsTable rec_format, NetricsTableRecSrc rec_src)
 Score all records from a record source against a query.
 
NetricsTableStats[] list (String[] tblnames, bool includeVarAttrNames)
 Lists statistics for tables currently loaded in the ibi™ Patterns - Search Server.
 
NetricsTableStats[] list (String[] tblnames)
 Lists statistics for tables currently loaded in the ibi™ Patterns - Search Server.
 
NetricsIdxStats[] idxlist (String[] tblnames)
 Lists statistics for partitioned indexes.
 
void thdelete (String[] theslist)
 Delete one or more thesauri currently loaded on the server.
 
String[] thlist ()
 Lists the thesauruses currently loaded in the ibi™ Patterns - Search Server.
 
NetricsThesStats[] thes_stats (String[] thes_names)
 Lists statistics on thesauri currently loaded on the server.
 
void tblmove (String oldName, String newName)
 Rename a table.
 
void tbldelete (String tblName)
 Delete a table.
 
NetricsRecord[] recget (String tblName, String[] recKeys)
 Get multiple records from a table.
 
NetricsRecord recget (String tblName, String recKey)
 Get a single record from a table.
 
NetricsRecord getChildRecord (String table_name, String parent_key, String child_key)
 See getChildRecords(string,string[],string[])
 
NetricsRecord[] getChildRecords (String table_name, String[] parent_keys, String[] child_keys)
 Get multiple records from a child table.
 
NetricsRecord[] getChildRecords (String table_name, ChildType child_type, String[] parent_keys, String[] child_keys)
 Get multiple records from a child table.
 
NetricsRecord[] getChildRecords (String table_name, ChildType child_type, String[] parent_keys, String[] child_keys, bool do_max_work)
 Get multiple records from a child table.
 
NetricsTableStats delChildRecord (String table_name, String parent_key, String child_key, bool doMaxWork)
 
NetricsTableStats delChildRecords (String table_name, String[] parent_keys, String[] child_keys, bool doMaxWork)
 Delete multiple records from a child table.
 
NetricsTableStats delChildRecords (String table_name, ChildType child_type, String[] parent_keys, String[] child_keys, bool doMaxWork)
 Delete multiple records from a child table.
 
NetricsCompoundRecord[] getCompoundRecords (String parent_table, String[] child_tables, params String[] parent_keys)
 Get multiple compound records.
 
NetricsTableStats recadd (String tblName, NetricsTableRecSrc src, bool doMaxWork, int estNumRecs)
 Add records to a table.
 
NetricsTableStats recadd (String tblName, NetricsTableRecSrc src, bool doMaxWork)
 recadd with no lock key or estimated number of record.
 
NetricsTableStats recadd (String tblName, NetricsRecord rec)
 Add a single record to a table.
 
NetricsTableStats recdelete (String tblName, String[] recKeys, bool doMaxWork)
 Delete records from a table.
 
NetricsTableStats recdelete (String tblName, String recKey)
 Delete a single record from a table.
 
NetricsTableStats[] delCompoundRecords (String parent_table, String[] child_tables, String[] parent_keys, bool delete_orphans, bool doMaxWork)
 Deletes a set of records from a parent table, and deletes associated child records from child tables.
 
NetricsTableStats recupdate (String tblName, NetricsTableRecSrc src, bool doMaxWork)
 Update records in a table.
 
String[] checkpoint (String[] tblnames)
 Checkpoint tables currently loaded in ibi Patterns - Search Engine. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].
 
NetricsObjectNameCollection checkpointObjects (NetricsObjectNameCollection objects)
 Checkpoint objects (tables, thesauri, character maps, rlink models) currently loaded in the ibi™ Patterns - Search Server. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].
 
String[] restore (String[] tblnames)
 Restore tables previously checkpointed. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].
 
NetricsObjectNameCollection restoreObjects (NetricsObjectNameCollection objects)
 Restore objects previously checkpointed. Obsolete. Checkpoint/Restore is deprecated in favor of Durable Data. See the ibi™ Patterns Installation Guide.")].
 
NetricsTableStats recreplace (String tblName, NetricsTableRecSrc src, bool doMaxWork)
 Replace records in a table.
 
NetricsTableStats recreplace (String tblName, NetricsRecord rec)
 Replace a single existing record in a table.
 
NetricsTableStats recupdate (String tblName, NetricsRecord rec)
 Update a single existing record in a table.
 
NetricsTableStats doRecOps (String table_name, bool do_max_work, NetricsRecOpSrc rec_ops)
 Perform a mixed set of record updates.
 
NetricsTableStats doRecOps (String table_name, bool do_max_work, params NetricsRecOp[] rec_ops)
 Perform a mixed set of record updates.
 
NetricsCmdStats[] cmdstats (String[] cmd_names)
 Retrieve processing statistics for commands.
 
NetricsCmdStats[] cmdstats (String[] cmd_names, double duration)
 Retrieve processing statistics for specified duration for commands.
 
NetricsCmdStats[] cmdstats (String[] cmd_names, double duration, double end_time)
 Retrieve processing statistics for specified time period.
 
void cmdstats_reset (String[] cmd_names, double start_time)
 Reset processing statistics for the specified commands.
 
void svrlogon ()
 Turn on search logging (must be enabled when the server starts up).
 
void svrlogoff ()
 Turn off search logging (must be enabled when the server starts up).
 
NetricsServerStats server_info ()
 Retrieve the server version information.
 
String svrversion ()
 Retreive the ibi™ Patterns - Search Server's version information.
 
bool isDecisionEngine ()
 
bool isGIPEnabled ()
 
bool isSortEnabled ()
 
bool isPsiEnabled ()
 
bool isDurableDataEnabled ()
 Return true if the server is using the durable-data feature.
 
String version ()
 Retreive the ibi™ Patterns - Search Server Interface version information.
 
ShutdownStatus svrshutdown ()
 Initiates a server shutdown.
 
ShutdownStatus svrshutdown (int timeout)
 Initiates a server shutdown.
 
void loadClusterConfiguration (String file_name)
 Load a new cluster configuration file on the gateway server.
 
void svrnoop ()
 
NetricsTranStats[] listTransactions (int idle_cutoff)
 Get statistics on open transactions.
 
void tranAbort (long tran_id)
 Abort a transaction.
 
void tranCommit (long tran_id)
 Commit a transaction.
 
void tranForceCommit (long tran_id)
 Commit a transaction even if it has errors.
 
void tranSetIdleOpts (int idle_time, String action)
 Set the idle transaction processing parameters on the server.
 
NetricsRecord[] recnext (NetricsTableCursor cursor)
 Retrieve records from a table cursor.
 
NetricsCompoundRecord[] compoundNext (NetricsTableCursor cursor)
 Retrieve compound records from a cursor.
 
int getMaxSocketUsage ()
 Return the maximum number of queries to perform on a given socket before closing it.
 
void setMaxSocketUsage (int val)
 Set the maximum number of queries to perform on a given socket before closing it.
 
TimeSpan? getMaxSocketLifetime ()
 Return the maximum lifetime of socket connections to the engine.
 
void setMaxSocketLifetime (TimeSpan? val)
 Set the maximum lifetime of socket connections to the engine.
 
int getConnectRetryCount ()
 Return the retry count for establishing a socket connection to the engine.
 
void setConnectRetryCount (int val)
 Set the retry count for establishing a socket connection to the engine.
 
int getConnectTimeout ()
 Return the per-attempt timeout for establishing a socket connection to the engine.
 
void setConnectTimeout (int val)
 Set the per-attempt timeout for establishing a socket connection to the engine.
 
CultureInfo setServerCultureInfo (CultureInfo culture_info)
 Sets the culture used by the interface when formatting and interpreting data exchanged with the server.
 
void setNetProtocols (ProtocolChoice protocols)
 Set the network protocols that will be used to connect to the ibi™ Patterns - Search Server.
 
long? getFormatTransmitDuration ()
 Gets the time spent formatting and transmitting the last command the current thread executed on this interface object.
 
long? getServerDuration ()
 Gets the time spent waiting for the server to begin responding to the last command the current thread executed on this interface object.
 
long? getReceiveParseDuration ()
 Gets the time spent receiving and parsing the response to the last command the current thread executed on this interface object.
 
long? getCommandDuration ()
 Gets the total time spent on the last command the current thread executed on this interface object.
 
bool getSSLEnabled ()
 Returns.
 
void setSSLEnabled (bool enable)
 Sets the SSL enable flag.
 
RemoteCertificateValidationCallback getCertificateValidator ()
 Get the current certificate-validation callback.
 
void setCertificateValidator (RemoteCertificateValidationCallback certValidator)
 Sets the certificate-validation callback.
 

Additional Inherited Members

- Public Types inherited from NetricsServerInterface.NetricsServerInterface
enum  ConnectionPoolingPolicy { None , Local , Shared }
 Possible connection pooling policies. More...
 
enum  ShutdownStatus { Initiated = 0 , Complete = 1 }
 Shutdown the ibi™ Patterns - Search Server. More...
 
- Protected Member Functions inherited from NetricsServerInterface.NetricsServerInterface
 NetricsServerInterface (String host, int port, bool debug, NetricsServerInterface.ConnectionPoolingPolicy pooling_policy)
 Create an object for interacting with an ibi™ Patterns - Search Server.
 

Detailed Description

This is an interface object associated with an explicit transaction.

NetricsTransaction is an extension of the NetricsServerInterface class. It provides all of the functionality of the NetricsServerInterface class, the difference being a NetricsTransaction object is coupled to a particular explicit transaction on the ibi™ Patterns - Search Server. NetricsTransaction is the only means provided in the .NET API for creating explicit transactions and associating operations with an explicit transaction.

For an explanation of transactions in ibi™ Patterns - Search please read the "ibi™ Patterns - Search Concepts Guide". This explains the difference between explicit and implicit transactions along with other items that should be understood before using transactions.

When a NetricsTransaction object is created a new explicit transaction is created on the ibi™ Patterns - Search Server. All operations performed through the NetricsTransaction object are associated with this explicit transaction. Once all work to be associated with the transaction is complete the NetricsTransaction object provides methods for terminating the transaction by either committing it, or aborting it, which rolls back all changes made under the transaction. Once a transaction has been closed through one of these calls all attempts to perform further update operations through the NetricsTransaction object will throw an exception.

Operations that do not update data on the ibi™ Patterns - Search Server, such as queries, status reports and fetching of records, are not associated with transactions. Such operations can be performed using a NetricsTransaction object, but if no updates are to be performed a NetricsServerInterface object should be used, not a NetricsTransaction object.

Transactions should never be left open. Once a NetricsTransaction object is created it MUST be closed by calling one of commitWork, forceCommitWork or abortWork, even if no operations were performed. The ibi™ Patterns - Search Server can be configured to automatically close transactions that are left open and idle longer than a designated period of time. Applications that open transactions by creating a NetricsTransaction object, and then let that object sit idle for long periods of time, may find that operations fail when the NetricsTransaction object is finally used because the transaction was automatically closed. Read only operations are not associated with a transaction, so even if such operations are performed through a NetricsTransaction object, the associated transaction is still left idle and may get automatically closed.

Objects of this class are NOT thread safe and should never be shared across threads.

Objects of this class are created using a NetricsConMgr object. There are no public constructors for this class.

For an example of how to use this class see the Namespace documentation.

See also
NetricsServerInterface, NetricsConMgr

Member Function Documentation

◆ abortWork()

void NetricsServerInterface.NetricsTransaction.abortWork ( )
inline

Abort the associated transaction.

All changes made under this transaction are rolled back.

After this call completes successfully any attempt to perform further update operations through this object will throw an execption.

◆ commitWork()

void NetricsServerInterface.NetricsTransaction.commitWork ( )
inline

Commit the associated transaction.

This performs a non-forced commit. If there were errors under this transaction the commit will fail with a DVK_ERR_HASERRORS error code.

After this call completes successfully any attempt to perform further update operations through this object will throw an execption.

◆ forceCommitWork()

void NetricsServerInterface.NetricsTransaction.forceCommitWork ( )
inline

Forcibly commit the associated transaction.

This performs a forced commit. Even if there were errors under this transaction the commit will occur. This should be used with extreme care. Committing errors can result in invalid and unusable data.

After this call completes successfully any attempt to perform further update operations through this object will throw an execption.

◆ getTranId()

int NetricsServerInterface.NetricsTransaction.getTranId ( )
inline

Obsolete. Use getTransactionId to obtain the full 64-bit id.

Returns
Returns a partial 32-bit id of the transaction that owns or claim this item.

If this item has not been modified or held by an open transaction this will be equal to NetricsTranStats.TRAN_ID_NULL (zero).