Dataset component to create in-memory tables
Icon

Properties and Events view
.png)
Purpose
TnxMemTable is a component for people that expect to have a TDataSet,
set it's FieldDefs and IndexDefs, call Open, be able to use it... Call
close and expect the memory to be freed. TnxMemTable is basically a
TnxTable that, on open, automatically creates a table in the "database
specific in-memory table" scope based on the FieldDefs (or on the
persistent field objects which are used to create the FieldDefs if
Fields have been defined but no FieldDefs). When you close the component
again that table is being deleted. If you don't specific a "TableName"
property an unique tablename is internally chosen for you. If a
TableName is specified it must be a unique name within the context of
that TnxDatabase. As long as the TnxMemTable is open you can access that
table from other TnxTable's or TnxQuery's under that name.
One thing that's important to mention. In-memory tables always "live"
wherever the "Buffer Manager" is (TnxServerEngine). A TnxRemoteServerEngine does not
contain a Buffer Manager. It's simply a proxy that turns method calls
into messages to be send over the transport which then get turned back
from messages to method calls on the TnxServerEngine by the command
handler in the server. That means if you are creating an in-memory
table, either direct or using the TnxMemTable, if the TnxDatabase is
connected to a TnxSession which in turn is connected to a
TnxRemoteServerEngine, then the table will exist inside the server
process. And all access to that table involves messages over the network.
If you want a "local" in-memory table, then you need to have a
TnxServerEngine in your application in addition to the
TnxRemoteServerEngine and you need to make sure your TnxDatabase that's
used to create the in-memory table is connected to that TnxServerEngine,
not the TnxRemoteServerEngine.












