I've downloaded the DLLDemo, and I've a question about the difference between passing a TOracleSession and using Share. The example says:
As far as I understand, the first method uses the same connection and session, while the second shares a connection but starts a new session ('copies')? The documentation is not clear about that, and I do not know OCI well enough to understand this.
That's because in some tests I made it looks I have two different transaction contexts (data modified by the sharing session are not seen in the shared one), and could get a deadlock while trying to modify the same data.
Therefore is it safe to "Share()" a session to a child thread, or a thread needs its own whole connection + session?
Code:
// This leads to one shared Session.
procedure LogonWithSession(Session: TOracleSession);
// The Share function 'copies' the connection to the DLLSession.
procedure LogonWithShare(Session: TOracleSession);
That's because in some tests I made it looks I have two different transaction contexts (data modified by the sharing session are not seen in the shared one), and could get a deadlock while trying to modify the same data.
Therefore is it safe to "Share()" a session to a child thread, or a thread needs its own whole connection + session?