theLink 10.0
Loading...
Searching...
No Matches
MqContextC_StorageApi_CS_API

MqContextC - setup and manage a storage used to persist data-packagesMore...

+ Collaboration diagram for MqContextC_StorageApi_CS_API:

Functions

int csmqmsgque.MqContextC.StorageDelete (int transLIdP_inout=0)
  C#: int ctx.StorageDelete(int transLIdP_inout = 0) C-API
delete the storage-row identified by the transLIdP_inout
 
int csmqmsgque.MqContextC.StorageImport (int transLIdP_inout=0)
  C#: int ctx.StorageImport(int transLIdP_inout = 0) C-API
import the storage-package into the read-data-package
 
void csmqmsgque.MqContextC.StorageClose ()
  C#: ctx.StorageClose() C-API
close the storage. …
 
void csmqmsgque.MqContextC.StorageDecrRef (int transLId)
  C#: ctx.StorageDecrRef(int transLId) C-API
decrease the internal refCount lock of the database-entry
 
void csmqmsgque.MqContextC.StorageIncrRef (int transLId)
  C#: ctx.StorageIncrRef(int transLId) C-API
increase the internal refCount lock of the database-entry
 
void csmqmsgque.MqContextC.StorageLog ([CallerMemberName]string callfunc=null)
  C#: ctx.StorageLog([CallerMemberName]string callfunc = null) C-API
log the storage the status of the open transactions
 
void csmqmsgque.MqContextC.StorageOpen (string storageFile)
  C#: ctx.StorageOpen(string storageFile) C-API
switch to a file-based-transaction-database
 
int csmqmsgque.MqContextC.StorageCount ()
  C#: int ctx.StorageCount() C-API
count the number of storage-rows
 
int csmqmsgque.MqContextC.StorageErrCnt (int transLId)
  C#: int ctx.StorageErrCnt(int transLId) C-API
increment and return the database row-error-count for the row defined with transLId
 
int csmqmsgque.MqContextC.StorageExport ()
  C#: int ctx.StorageExport() C-API
export the read-data-package into the STORAGE
 
List< object > csmqmsgque.MqContextC.StorageResolve ()
  C#: {otherCtxP:MqContextC otherLIdP:int} ctx.StorageResolve() C-API
extract the context->link.protect.rmtTransLId entry from the database
 

Detailed Description

MqContextC - setup and manage a storage used to persist data-packages

The storage is divided into: INTERNAL and EXTERNAL storage. Only the read-data-package can be stored or dumped into the storage.

The read-data-package is saved into the storage using:

ServiceStorage setup a service listen on a MqContextC_ServiceApi_Identifer and save all read-data-package into the STORAGE
StorageExport export the read-data-package into the STORAGE

The read-data-package is restored from the storage using:

StorageImport import the storage-package into the read-data-package
ProxyForward send the entire read-data-package-data to the link-target
All this usually happen in an Event Handler

Some important facts of the storage-feature:

The following internal storages are supported:

default
The default-storage is set with the configuration parameter --storage fileName and defaults to "#memdb#". If a package have to be saved into the storage and the storage is not open the default-storage id used. The open will always be performed. If an explicit storage is required the default can be changed or a storage can explicit be opened with MqStorageOpen. Keep in mind that the default-storage is a per-context configuration but only one storage per process or thread is currently supported.
memdb
This is the default storage and can be set explicitly with MqStorageOpen using the "#memdb#" parameter.
tmpdb
This storage is like an in-memory-storage but export data to the TEMPORARY filesystem if the application run out of memory. This storage can explicit be set with MqStorageOpen with the parameter "#tmpdb#".
filedb
This storage always work on files. Only this storage is persistent and can explicit be set with MqStorageOpen with the storageFile parameter.

Performance analyse:

database performance host crash application crash info
memdb 30.000 data lost data lost non persistent
tempdb < 30.000 data lost data lost uses memory and/or temporary file
filedb (mem) 10.000 data lost data safe in memory filesystem
filedb (disc) 50 data safe data safe disc-speed is the key factor

Function Documentation

◆ StorageClose()

void csmqmsgque.MqContextC.StorageClose ( )
inline

C#: ctx.StorageClose() C-API
close the storage. …

Definition at line 1822 of file MqContextC.cs.

1822 {
1823 MkErrorE errVal = Mq.MqStorageClose(mkrt, hdl);
1824 MkErrorC.Check(hdl, errVal);
1825 }
csmqmsgque.MqMsgque Mq
static void Check(IntPtr ctx, MkErrorE err)
MkErrorE

◆ StorageCount()

int csmqmsgque.MqContextC.StorageCount ( )
inline

C#: int ctx.StorageCount() C-API
count the number of storage-rows

Definition at line 1858 of file MqContextC.cs.

1858 {
1859 Int32 cnt_out;
1860 MkErrorE errVal = Mq.MqStorageCount(mkrt, hdl, out cnt_out);
1861 MkErrorC.Check(hdl, errVal);
1862 return cnt_out;
1863 }

◆ StorageDecrRef()

void csmqmsgque.MqContextC.StorageDecrRef ( int transLId)
inline

C#: ctx.StorageDecrRef(int transLId) C-API
decrease the internal refCount lock of the database-entry

Definition at line 1828 of file MqContextC.cs.

1828 {
1829 MkErrorE errVal = Mq.MqStorageDecrRef(mkrt, hdl, transLId);
1830 MkErrorC.Check(hdl, errVal);
1831 }

◆ StorageDelete()

int csmqmsgque.MqContextC.StorageDelete ( int transLIdP_inout = 0)
inline

C#: int ctx.StorageDelete(int transLIdP_inout = 0) C-API
delete the storage-row identified by the transLIdP_inout

Definition at line 1806 of file MqContextC.cs.

1806 {
1807 MkErrorE errVal = Mq.MqStorageDelete(mkrt, hdl, ref transLIdP_inout);
1808 MkErrorC.Check(hdl, errVal);
1809 return transLIdP_inout;
1810 }

◆ StorageErrCnt()

int csmqmsgque.MqContextC.StorageErrCnt ( int transLId)
inline

C#: int ctx.StorageErrCnt(int transLId) C-API
increment and return the database row-error-count for the row defined with transLId

Definition at line 1866 of file MqContextC.cs.

1866 {
1867 Int32 cnt_out;
1868 MkErrorE errVal = Mq.MqStorageErrCnt(mkrt, hdl, transLId, out cnt_out);
1869 MkErrorC.Check(hdl, errVal);
1870 return cnt_out;
1871 }

◆ StorageExport()

int csmqmsgque.MqContextC.StorageExport ( )
inline

C#: int ctx.StorageExport() C-API
export the read-data-package into the STORAGE

Definition at line 1874 of file MqContextC.cs.

1874 {
1875 Int32 ltid_out;
1876 MkErrorE errVal = Mq.MqStorageExport(mkrt, hdl, out ltid_out);
1877 MkErrorC.Check(hdl, errVal);
1878 return ltid_out;
1879 }

◆ StorageImport()

int csmqmsgque.MqContextC.StorageImport ( int transLIdP_inout = 0)
inline

C#: int ctx.StorageImport(int transLIdP_inout = 0) C-API
import the storage-package into the read-data-package

Definition at line 1813 of file MqContextC.cs.

1813 {
1814 MkErrorE errVal = Mq.MqStorageImport(mkrt, hdl, ref transLIdP_inout);
1815 MkErrorC.Check(hdl, errVal);
1816 return transLIdP_inout;
1817 }

◆ StorageIncrRef()

void csmqmsgque.MqContextC.StorageIncrRef ( int transLId)
inline

C#: ctx.StorageIncrRef(int transLId) C-API
increase the internal refCount lock of the database-entry

Definition at line 1834 of file MqContextC.cs.

1834 {
1835 MkErrorE errVal = Mq.MqStorageIncrRef(mkrt, hdl, transLId);
1836 MkErrorC.Check(hdl, errVal);
1837 }

◆ StorageLog()

void csmqmsgque.MqContextC.StorageLog ( [CallerMemberName] string callfunc = null)
inline

C#: ctx.StorageLog([CallerMemberName]string callfunc = null) C-API
log the storage the status of the open transactions

Definition at line 1840 of file MqContextC.cs.

1840 {
1841 IntPtr callfunc_cstr = Marshal.StringToHGlobalAnsi(callfunc);
1842 MkErrorE errVal = Mq.MqStorageLog(mkrt, hdl, callfunc_cstr);
1843 Marshal.FreeHGlobal(callfunc_cstr);
1844 MkErrorC.Check(hdl, errVal);
1845 }

◆ StorageOpen()

void csmqmsgque.MqContextC.StorageOpen ( string storageFile)
inline

C#: ctx.StorageOpen(string storageFile) C-API
switch to a file-based-transaction-database

Definition at line 1848 of file MqContextC.cs.

1848 {
1849 IntPtr storageFile_cstr = Marshal.StringToHGlobalAnsi(storageFile);
1850 MkErrorE errVal = Mq.MqStorageOpen(mkrt, hdl, storageFile_cstr);
1851 Marshal.FreeHGlobal(storageFile_cstr);
1852 MkErrorC.Check(hdl, errVal);
1853 }

◆ StorageResolve()

List< object > csmqmsgque.MqContextC.StorageResolve ( )
inline

C#: {otherCtxP:MqContextC otherLIdP:int} ctx.StorageResolve() C-API
extract the context->link.protect.rmtTransLId entry from the database

Definition at line 1882 of file MqContextC.cs.

1882 {
1883 IntPtr otherCtxP_out;
1884 Int32 otherLIdP_out;
1885 MkErrorE errVal = Mq.MqStorageResolve(mkrt, hdl, out otherCtxP_out, out otherLIdP_out);
1886 MkErrorC.Check(hdl, errVal);
1887 List<object> __retVal__L = new List<object>();
1888 __retVal__L.Add(MqContextC.MqContextC_ObjNew(otherCtxP_out));
1889 __retVal__L.Add(otherLIdP_out);
1890 return __retVal__L;
1891 }