Jump to content

session and database


AntonioCuomo

Recommended Posts

If j have a TABSDATABASE on unimainmodule the component is shared with all session?

 

How have a TBSDATABASE for every session?

 

Example:

 

User1  --->    DB0001.abs

User2 ---->    DB0002.abs

User3 ---->    DB0003.abs

....

 

if j change at connession  the filename for all user the DB is the DB of last user.

 

Is ABsolute Database not compatible?

 

 

Link to comment
Share on other sites

My understanding (from the online UniGui documentation) is that the ServerModule exists for all sessions while the MainModule is created separately for each session.

 

So if you put a database connection in MainModule, it will be specific to one user and session.

 

I may be wrong, but I think a database connection in ServerModule is not recommended.

 

Sent from my SM-P900 using Tapatalk

Link to comment
Share on other sites

  • Administrators

Hi,

 

You must follow same principle when you use BDE in a multi-threaded app. Basically you must have a separate TABSSession object for each uniGUI session.

 

See here:

http://www.componentace.com/multi-thread-delphi.htm

 

 

Put a TABSSession on MainModule and set AutoSessionName -> True.

Put a TABSDatabase on MainModule and set its SessionName to TABSSession.Session name.

.

.

.

Link to comment
Share on other sites

  • Administrators

If j have a TABSDATABASE on unimainmodule the component is shared with all session?

 

How have a TBSDATABASE for every session?

 

Example:

 

User1  --->    DB0001.abs

User2 ---->    DB0002.abs

User3 ---->    DB0003.abs

....

 

if j change at connession  the filename for all user the DB is the DB of last user.

 

Is ABsolute Database not compatible?

 

In a normal app all users must share same ABS database file.

Link to comment
Share on other sites

Correct!!!

I have put an ABSSession in UniMainModule Form and assigned the Session Name to ABSDatabase.

Now every time UniMainModule is created (= new user) then a new session is created and the database works perfect!

 

**Note you have to put the database inside the isapi dll folder.

UniMainModule.ABSDatabase1.close;
UniMainModule.ABSDatabase1.DatabaseFileName := UniServerModule.FilesFolderPath + 'TestFolder/Novus_Conceptus.abs' ;
UniMainModule.ABSDatabase1.Open;
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...