Using TOracleSessionPool in Delphi (Accessing Session from the session pool)

Joseph

Member
Can anybody provide me with an example on how to use TOracleSessionPool in Delphi. I am creating a multithreaded application and would like to use this component to create a new session whenever a new thread is created.
I need to find out what are the properties that I need to setup in my OracleSession which I will be putting on the Pool and how can my application access this session after I have created a new thread.
 
Each thread needs its own TOracleSession instance. These session components will take a database connection from the pool if you set TOracleSession.Pooling to spInternal. This is really all that is necessary, there is no code involved. Calling TOracleSession.Logon now reserves a connection from the pool, and calling Logoff releases the connection in the pool for other threads to use.

You can tune pooling parameters by setting various properties of the common SessionPool instance. See the TOracleSessionPool topic in the help file for details.
 
I did what you said and work perfectly. Thanks a lot. I have another issue where I am getting this error when running my thread.

Project Inbound.exe raised exception class EOracleError with message
 
If the primary key column value is obtained from a sequence, then the sequence is apparently not aligned with the actual primary key data in your database. You will need to performa "select seq.nextval from dual" until it reaches the current maximum primary key value.
 
Back
Top