DataSnap Delphi 2010 no Windows 7
25/12/2009
0
este ano criei um sistema multicamadas, com o novo DataSnap do D2009, consegui executa-lo sem maiores problemas, no Win XP, 2000 Server, só que esta semana resolvi testar o D2010 para ver se faço um upgrade do meu Delphi e instalei em uma maquina com Windows 7, tentei compilar o Modulo Servidor e não foi gerado erro, só que quando entra em algum datamodule que tenho o TDSServer e o TDSTCPServerTransport ele me gera uma exceção e finaliza meu sistema pude ver que ele gera um dos o erros na Unit "IdThread". Os erros são de Access Violation
Não sei dizer se o problema esta no DataSnap D2010 que baxei ou na incompatibilidade com Windows 7
Se alguém ja passou por isso ou sabe como resolver ... me da um dia ok.
vlw pessoal.
Jardson Cleyton
Posts
25/12/2009
Jardson Cleyton
28/12/2009
Jardson Cleyton
quando eu retirei os componentes os componentes TDSSeverClass que estavam ligados ao DSServer ... pela propriedade Server ... perdeu a referiência, hj testando o lado do Cliente percebi que não estava funcionado o Generate DataSnap Class do SQLConnection, quando fui olhar a propriedade dos DSServerClass estão vazias ... quando recoloquei, o mesmo problema voltou, se alguém souber o que é agradeço ... voltando a afirmar com o D2009 e Win 2003 Server funciona sem problema ... estou com problema com D2010 e Win 7.
vlw pessoal.
29/12/2009
Jardson Cleyton
LIOHandler := Server.IOHandler.Accept(Binding, Self, LYarn);
dessa procedure que fica na unit IdCustomTCPServer
procedure TIdListenerThread.Run;
var
LContext: TIdServerContext;
LIOHandler: TIdIOHandler;
LPeer: TIdTCPConnection;
LYarn: TIdYarn;
begin
Assert(Server<>nil);
Assert(Server.IOHandler<>nil);
LContext := nil;
LPeer := nil;
LYarn := nil;
try
// GetYarn can raise exceptions
LYarn := Server.Scheduler.AcquireYarn;
LIOHandler := Server.IOHandler.Accept(Binding, Self, LYarn);
if LIOHandler = nil then begin
// Listening has finished
Stop;
Abort;
end else begin
// We have accepted the connection and need to handle it
LPeer := TIdTCPConnection.Create(nil);
LPeer.IOHandler := LIOHandler;
LPeer.ManagedIOHandler := True;
end;
// LastRcvTimeStamp := Now; // Added for session timeout support
// ProcessingTimeout := False;
// Check MaxConnections
if (Server.MaxConnections > 0) and (not TIdThreadSafeList(Server.Contexts).IsCountLessThan(Server.MaxConnections)) then begin
FServer.DoMaxConnectionsExceeded(LIOHandler);
LPeer.Disconnect;
Abort;
end;
// Create and init context
LContext := Server.FContextClass.Create(LPeer, LYarn, Server.Contexts);
LContext.FServer := Server;
// We set these instead of having the context call them directly
// because they are protected methods. Also its good to keep
// Context indepent of the server as well.
LContext.OnBeforeRun := Server.ContextConnected;
LContext.OnRun := Server.DoExecute;
LContext.OnAfterRun := Server.ContextDisconnected;
LContext.OnException := Server.DoException;
//
Server.ContextCreated(LContext);
//
// If all ok, lets start the yarn
Server.Scheduler.StartYarn(LYarn, LContext);
except
on E: Exception do begin
// RLebeau 1/11/07: TIdContext owns the Peer by default so
// take away ownership here so the Peer is not freed twice
if LContext <> nil then begin
TIdServerContextAccess(LContext).FOwnsConnection := False;
end;
FreeAndNil(LContext);
FreeAndNil(LPeer);
// Must terminate - likely has not started yet
if LYarn <> nil then begin
Server.Scheduler.TerminateYarn(LYarn);
end;
// EAbort is used to kick out above and destroy yarns and other, but
// we dont want to show the user
if not (E is EAbort) then begin
Server.DoListenException(Self, E);
end;
end;
end;
end;
... vlw pessoal
Clique aqui para fazer login e interagir na Comunidade :)