Originally posted by fzapata:
I changed TOracleSession.ThreadSafe := true and seems to be working fine, but under certain circumstances, when the RemoteDataModule is not loaded and several users connect at the same time it hangs.
We are having the same problem using DOA 3.4x. DOA 3.3.x does not have the problem. We are on Oracle 8.1.5
Our server consists of a main remotedatamodule with a
TOracleSessionComponent. The server also has multiple child datamodules
with TOracleDataSets and TOracleQueries. When a child datamodule is
created, the main rdm session is assigned to the Session property of the
child datamodule's queries and datasets.
This is how we create a typical child datamodule com object:
function TAMSBusinessServer.Get_dmdBRANCHPartySvr: IdmdBRANCHPartySvr;
begin
if not Assigned( FdmdBRANCHPartySvr ) then
FdmdBRANCHPartySvr := TComponentFactory.Create(ComServer,
TdmdBRANCHPartySvr, Class_dmdBRANCHPartySvr, ciInternal,
tmApartment);
Result := FdmdBRANCHPartySvr.CreateComObject( nil ) as IdmdBRANCHPartySvr;
Result.MainRDM := Self;
end;
When the MainRDM property is set, a side effect is to set the session :
procedure TdmdBaseSession.SetSession;
var
ASession : TOracleSession;
i : Integer;
begin
ASession := nil;
if Assigned( FMainRDM ) then
ASession := TOracleSession( FMainRDM.OracleSession );
if ASession = nil then
raise Exception.Create( 'Session initialization failed' );
for i := 0 to ComponentCount - 1 do begin
if Components
is TOracleDataSet then
TOracleDataSet( Components ).Session := ASession;
if Components is TOracleQuery then
TOracleQuery( Components ).Session := ASession;
end;
end;
procedure TdmdBaseSession.Set_MainRDM(const Value: IAMSBusinessServer);
begin
FMainRDM := Value;
SetSession;
end;