What does OraSession->AssignConnect() exactly do?

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
ThomasB
Posts: 6
Joined: Tue 09 Nov 2004 13:50
Location: Hannover, Germany

What does OraSession->AssignConnect() exactly do?

Post by ThomasB » Mon 15 Nov 2004 15:13

Hi,

I use OraSession->AssignConnect() often, because I have a central db-connection bpl and many other bpls with OraSession-objects in it. On startup of the program, I connect the session in the connection bpl to the db and use AssignConnect() to assign the connection to the sessions in the other bpls.
When looking on the database, I see only one session. Does that mean, that my OraSession-objects are not independend from each other? Does the session with AutoCommit=true affect the other sessions with AutoCommit=false?

Thanks,
Thomas

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Tue 16 Nov 2004 11:17

OraSession->AssignConnect copies OCI session handles from the source TOraSession. Thus you can see only one session on Oracle server. It copies connection parameters such as Options.Net, Username, Password, Server, that cannot be changed without reconnection.

Guest

Post by Guest » Tue 16 Nov 2004 11:30

Hello,

thanks for the answer. That means that two OraSession objects, where one got the connection via AssignConnect() from the other one, are not independend. When I need truely seperated sessions concerning the AutoCommit functionality, I have to create two database sessions, right?

Thanks,
Thomas

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Tue 16 Nov 2004 12:50

You can assign the different values of AutoCommit property in two TOraSession objects linked by AssignConnect. They will work in different ways.

Post Reply