TAstaServerSocket.ThreadingModel
Applies to
TAstaServerSocket
Declaration
type TAstaThreadModel = (tmSingleSession, tmPooledSessions,
tmPersistentSessions);
property ThreadingModel: TAstaThreadModel;
Description
See Threading
ASTA servers for an overview.
tmSingleSession This is the default model and should be the fastest for small numbers of users or larger numbers of users that don't have excessive concurrent activity.
tmPooledSessions This is a resource conscious scaling model. Use the DataBaseSessions property to set the number of sessions that are created at server startup. All connections are created at server startup, and client requests are paired with sessions from this pool on an as-needed basis. If you are trying to support a large number of users, this is the model to use. The pooled number increases dynamically if there is a demand.
tmPersistentSessions
This allows each client to connect to a session when the client connects
to the server. The sessions are persistent. Used in conjunction with the TAstaClientSocket.Login property,
you can use this threaded model to allow users to login with their actual database login, and even allow
each client to access a separate alias. When the client connects, the socket triggers an event (DBLoginEvent)
to create a database session. Any subsequent client database access will pair the incoming socket with
the session chosen at startup, within a spawned thread. When the client disconnects, the session is disposed
of.
When an ASTA server runs in this mode, ASTA clients can fire a server query and keep a cursor open
on the server. Instead of fetching all the records in the query the client can request X number of rows
via the PacketSize property. See Packet
Fetches for a Full discussion of Packetized Querys