I'm searching for information on database connectivity (Firebird in my case) with IntraWeb Applications.
I especially need to know the difference(s) involved in using the database on the TDataModule with LockDataModule function, or using the database on the UserSessionUnit. For example i need to have the database totally disconnected if no users are using the server, and at most 30 users will be connected.
I may at worst have to connect to some old paradox Database and i need a structure that could handle that (i know that i'll have to generate a folder based on WebApplication.AppID to handle sessions). At worst...
Thanks in advance for any piece of information or useful links you could provide me ^^
Scenario 1 - You leave "Pool Data Connections" unchecked in the Intraweb Application Wizard
In this scenario the wizard creates a
ServerController
, aUserSession
but not aDataModule
. You place your database, session and dataset components on theUserSession
.Whenever a new user connects to your website a new instance of the
UserSession
is created and a connection to the database is made. When theServerController.SessionTimeOut
expires due to user inactivity theUserSession
is destroyed and that particular connection to the database is severed.For 30 concurrent users this model will probably be fine for you and should guarantee that all database connections will be severed when the website is not in use.
Scenario 2 - You check "Pool Data Connections" in the Intraweb Application Wizard
As well as the
ServerController
and theUserSession
the wizard will create an emptyDataModule
. You place your database, session and dataset components on theDataModule
.The
ServerModule
has aTIWDataModulePool
component on it which hasPoolCount
property.When your application starts it creates
PoolCount
instances of theDataModule
each one of which makes a connection to the database. As your pages require database access they callLockDataModule
andUnlockDataModule
to temporarily make use of one of theDataModule
instances from the pool.When your application closes the
DataModule
instances in the pool are destroyed and their connections to the database are closed.This model is appropriate when having an open database connection per user would exceed the capabilities of your database server. For just 30 users connecting to a FireBird database I don't believe it would be required.