MTS / COM+ Issue

rpynor

Member²
Hi there,

We have a COM+ application, which is basically a wrapper for the TOracleQuery component, allowing us to execute dyanamic sql.

-> Transactional support is set to 'Supported'
-> Database behaviour / mts transactional behaviour is correct.
-> we are using MTS pooling, with moImplicit

However, when the COM+ application is shut down, we get an application error in dllhost.exe.

If we change the pooling to be spInternal, all is fine.

Here is a code snippet to reproduce the problem:

function TDynamicQuery.Execute(): integer;
var
lQuery : TOracleQuery;
begin
lQuery := TOracleQuery.Create(nil);
lQuery.Session := TOracleSession.Create(lQuery);
lQuery.Session.LogonUsername := 'username';
lQuery.Session.LogonPassword := 'password';
lQuery.Session.LogonDatabase := 'database';
lQuery.Session.Pooling := spMTS;
lQuery.Session.MTSOptions := [moImplicit];
lQuery.Session.LogOn;
lQuery.SQL.Text := 'select * from TableName';
lQuery.Execute;
SetComplete;
lQuery.Session.LogOff;
FreeAndNil(lQuery);
result := 0;
end;

If you put this into a COM+ (server) application, and call it from a client app, then it appears to run Ok, until you manually close the COM+ application from the Components Services Explorer.

This then (intermittently) gives a dllhost.exe application error.

if you then change the pooling method to be spInternal, it works fine,and does not ccause the crash in dllhost.exe

Other Info:

OS: Windows XP
DOA Version: 346
Delphi: 7
Oracle: 9i

Will upgrading to the new DOA 4 overcome this issue? Any help much appreciated.

Regards,

Rohan
 
Thats all we get!

Details:

dllhost.exe - Application Error

The instruction at "0x013a716e" referenced memory at "0x013a716e". The memory could not be "read".

Click Ok to terminate the program.
Click on Cancel to debug the program.

If we debug...nothing happens.

This happens when the MTS application shuts down. I have put a handler in for the destroy of the com+ application (which opens a dialog), and and that executes Fine.

Hope this helps.

Regards,

Rohan
 
Back
Top