Board index » delphi » Using Sessions in an MDI app.

Using Sessions in an MDI app.

I have an MDI application that use MDI child forms.
Users can open twice a particular form to enter data.
That's why I need Sessions.

I tried many combination of Tsession, TDatabase and TTable
components and it still doesn't work.

Does anybody know how to use Sessions?

Thanks.

 

Re:Using Sessions in an MDI app.


Quote
i...@hopem.com (Daniel Gagnu) wrote:

DG> I have an MDI application that use MDI child forms.
DG> Users can open twice a particular form to enter data.
DG> That's why I need Sessions.

Not necessarily. Putting TSession and TDatabase components on the MDI
children allow them each their own sessions, but as the execution
of all MDI children takes place within the main program thread, SQL calls
by a MDI will still block execution of the program, i.e. the program <and
all other MDI children> will hourglass until that MDI child's TSession has
received a response from the database.

If you create the TSession and TDatabase on the MDI parent, the MDI
children's TQuery and TTable components can all share the same the TSession
and TDatabase components. The app is now using less memory and only a
single connection is made to the database. And you still have the exact
same application behaviour as using a session & database per MDI child.

You only need seperate sessions and database components if you want to
multi-thread the MDI childrens' access to the database.

regards,
Billy
vsl...@onwe.co.za           Verreynne Software Labs,   Johannesburg  Z.A.

 * RM 1.31 3337 *

Other Threads