关于TSession的问题,请大家帮忙解答!数据库访问时,
1.Session有什么作用?
2.什么是Session?
3.多线程访问db时需要给每个线程建立一个Session吗?
4.如果多个线程使用一个Session会有什么后果?敬请各位高人帮忙解答,多谢

解决方案 »

  1.   

    hellolongbin(一个人[年长资深少男]) :    因为手头暂时没有什么书,看了看帮助,也没找到答案,还请您多多指点。
      

  2.   

    管理数据库连接的。你可以查看帮助文件。
    就象数据库中包含数据集一样,TSession 是在 数据库之上的。TSession provides global management of a group of database connections within an application.UnitdbtablesDescriptionUse TSession to manage a group of database connections within an application. There are three uses for TSession: standard, multiple net files for Paradox, and multi-threaded database applications.Delphi automatically creates a globally accessible default TSession component named Session for all database applications. The default session component handles standard database connections. An application can control the default session by accessing its properties, events, and methods at runtime.Database applications that must simultaneously access Paradox tables located in different network locations can establish multiple sessions, one for each network location.Finally, database applications that must establish multiple, concurrent connections to the same database, such as performing two queries against the same data at once, are multi-threaded applications. Multi-threaded applications must create and maintain one additional session component for each simultaneous connection to a single database server.Note: Applications that maintain multiple sessions can manage them through the TSessionList component. A default session list component, called Sessions梟ote the plural which distinguishes it from the default session component, Session梚s automatically created for all database applications.