connect simultaneously to 2 LETODB servers

Fórum sobre Banco de Dados e RDDs para Clipper/[x]Harbour.

Moderador: Moderadores

noomen
Usuário Nível 1
Usuário Nível 1
Mensagens: 4
Registrado em: 27 Ago 2012 11:58
Localização: tunis

connect simultaneously to 2 LETODB servers

Mensagem por noomen »

how I can connect simultaneously to two LETODB servers from a workstation on the same application

thanks in advance
alxsts
Colaborador
Colaborador
Mensagens: 3092
Registrado em: 12 Ago 2008 15:50
Localização: São Paulo-SP-Brasil

connect simultaneously to 2 LETODB servers

Mensagem por alxsts »

Welcome to this Forum noomen!

Please, refer to this material: Can a single program to run multiple LetoDB servers?
[]´s
Alexandre Santos (AlxSts)
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

connect simultaneously to 2 LETODB servers

Mensagem por Itamar M. Lins Jr. »

Hi!

If use LetoDBf.

Read the file of letodbf README.TXT
3.2 Run as Windows@ service

For use as "Windows service" server executable must be compiled for this task, see 2.1
To install LetoDbf as service, the executable must be placed in a directory covered by the OS
system search paths to be found from any place. Then run letodb with 'install' parameter:
letodb.exe install [letodb.ini]
The 3rd param is optinonal for different config to use for multiple LetoDBf services, e.g.
running at different disk partitions.

Verify in letodbf.log that the service was successful installed and started.
To check the state of a Windows service use the GUI management for services.
Alternatively at command line can be used to start/ stop the service:
net start LetoDBf_Service
net stop LetoDBf_Service
Port = 2812 - Server port number, default is 2812 [ then 2813 used for second socket ]
There are two! ports used by server, this and the following number.
If change PORT via letodb.ini for 2820 (example) second socket up 2821

Best regards,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
deividdjs
Usuário Nível 3
Usuário Nível 3
Mensagens: 377
Registrado em: 19 Set 2006 09:39
Localização: Foz do Iguaçu / Pr

connect simultaneously to 2 LETODB servers

Mensagem por deividdjs »

boa tarde, Prezados!

até agora não consegui fazer funcionar dois servidores simultâneos .. alguém já ??

dá uma luz por favor .. ja fiz conforme manual e nada ..

liberei no firewall as portas 2812 e 2813

criei dois arquivos letodb1.ini e letobd2.ini com suas respectivas configurações e nada ..

alguem ja conseguiu fazer ??

Abraço !

Djs
Windows 11 + Harbour 3.2 + MINGW64 gcc 14.1.0 + Visual Lib + GTWVG + LETODBF WINDOWNS/LINUX
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

connect simultaneously to 2 LETODB servers

Mensagem por Itamar M. Lins Jr. »

Olá!
Aqui foi de boa.
c:\dev\letodbf\bin
Coloquei na porta padrão 2812

Código: Selecionar todos

Port = 2812              
c:\dev\letodbf\bin\bin2
Coloquei na porta padrão 2820

Código: Selecionar todos

Port = 2820              
Detalhe!
Usei o letodb.hbp não usei o serviço.
Dois letodb.exe e dois letodb.ini
Se for usar o serviço precisa mudar o nome do outro "letodbf_service" NOS FONTES! quando for compilar usando letodbsvc.hbp
Dai não quiz mexer.

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
deividdjs
Usuário Nível 3
Usuário Nível 3
Mensagens: 377
Registrado em: 19 Set 2006 09:39
Localização: Foz do Iguaçu / Pr

connect simultaneously to 2 LETODB servers

Mensagem por deividdjs »

vlw Itamar .. mudando o nome do serviço e compilando outro letodbf acredito q foi mais facil .. hehehe funcionou !! abs!
Anexos
2 serviços ativos windows
2 serviços ativos windows
Windows 11 + Harbour 3.2 + MINGW64 gcc 14.1.0 + Visual Lib + GTWVG + LETODBF WINDOWNS/LINUX
Avatar do usuário
deividdjs
Usuário Nível 3
Usuário Nível 3
Mensagens: 377
Registrado em: 19 Set 2006 09:39
Localização: Foz do Iguaçu / Pr

connect simultaneously to 2 LETODB servers

Mensagem por deividdjs »

Boa noite Itamar .. mais uma pergunta tu q é mestre no LETODBF ...

no meu sistema eu tenho a estrutura de pasta assim :

\CONTROLE_\LOJA_00
\CONTROLE_\LOJA_01
\CONTROLE_\LOJA_03

e asssim por diante ....

antes do LETODBF instalado eu usava a função DIRCHANGE(LOJA_01)... (LOJA_02) e assim por diante para comutar os diretorios e acessar as bases q aí estão ... como faço essa tarefa com o LETO ??

Abraço amigo ..

Djs.
Windows 11 + Harbour 3.2 + MINGW64 gcc 14.1.0 + Visual Lib + GTWVG + LETODBF WINDOWNS/LINUX
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

connect simultaneously to 2 LETODB servers

Mensagem por Itamar M. Lins Jr. »

Olá!
Tem duas opções:

Código: Selecionar todos

      LETO_SETPATH( cPath[, lDefault ] )                         ==> cOldPath
 It set "SET PATH TO ( cPath )" at LetoDBf server.
 This path(s) are relative to "DataPath" in 'letodb.ini' configuration and are searched for DBF tables
 when *plain* table filenames without a path component are used for DbUseArea()/ DbSetIndex().
 With optional given <lDefault> as true (.T.), "SET DEFAULT TO ( cPath )" is set at server,
 then this will become a subdirectory of "DatPath" where *new* tables are created.
 Also herefor filename must be given in *plain* form -- when containing a path, filenames are ever
 treated as relative to 'DataPath'.
 Setting the DEFAULT path also set 'DataPath' of 'letodb.ini' as search PATH, if its not already set.
 Setting a search PATH also adds 'DataPath' itself as additional last search PATH.
 <cOldPath> will be just a single ";" if no connection active or else error occured, else it is
 the relative path(s) formerly active -- useful to temporary change and reset back to before.
 Please note that no verification is done if the paths already exist, so non existing paths will
 lead to not found files or even an create error.
E como vc pode fazer tudo dentro das pasta PRINCIPAL. Pode criar, apagar, etc ficando na pasta principal.

Código: Selecionar todos

    Leto_Directory( [ cDir ] [, cnAttr] )                    ==> aDirectory
 Returns a content of directory at the server in the same format as Directory() function.
 With no given <cDir> the DataPath root directory is used.

      Leto_DirExist( cPath )                                   ==> lDirExists
 Determine if cirectory exist at the server, analog of Leto_File() function, but
 for directories

      Leto_DirMake( cPath )                                    ==> -1 if failed
 Creates a directory at the server. [ renamed, formerly: Leto_MakeDir ]

      Leto_DirRemove( cPath )                                  ==> -1 if failed
 Deletes a directory at the server
Eu não uso a primeira opção. Pq tem que lembrar de voltar para a pasta principal, ou os comandos("use, leto_file(), etc) irão dar problema. Evitei usar.

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
Itamar M. Lins Jr.
Administrador
Administrador
Mensagens: 7928
Registrado em: 30 Mai 2007 11:31
Localização: Ilheus Bahia
Curtiu: 1 vez

connect simultaneously to 2 LETODB servers

Mensagem por Itamar M. Lins Jr. »

Olá!
Eu usaria:

Código: Selecionar todos

use \LOJA_00\estoque.dbf ...
use \LOJA_01\estoque.dbf ...
use \LOJA_03\estoque.dbf ...
...
IF LETO_FILE("\LOJA_00\estoque.dbf")
IF LETO_FILE("\LOJA_01\estoque.dbf")
IF LETO_FILE("\LOJA_03\estoque.dbf")
Uma vez que, a pasta principal está setada no DataPath=\controle

Saudações,
Itamar M. Lins Jr.
Saudações,
Itamar M. Lins Jr.
Avatar do usuário
deividdjs
Usuário Nível 3
Usuário Nível 3
Mensagens: 377
Registrado em: 19 Set 2006 09:39
Localização: Foz do Iguaçu / Pr

connect simultaneously to 2 LETODB servers

Mensagem por deividdjs »

entendi! o unico problema é q tenho q mudar toda a estrutura do meu sistema .. e se eu conseguisse mudar de pasta ... não teria q mexer em nada !

seria muito bom se essa função Leto_SetPath( cLoja, .T. ) funcionasse como o DIRCHANGE(cLoja) ... AÍ eu estaria no céu ..rsrs mais fiz varios testes e não funciona igual ... mais blz .. vou ver o q eu faço ..

Obrigado meu amigo ... forte abraço!

Sds,

Deivid
Windows 11 + Harbour 3.2 + MINGW64 gcc 14.1.0 + Visual Lib + GTWVG + LETODBF WINDOWNS/LINUX
Avatar do usuário
JoséQuintas
Administrador
Administrador
Mensagens: 20267
Registrado em: 26 Fev 2007 11:59
Localização: São Paulo-SP

connect simultaneously to 2 LETODB servers

Mensagem por JoséQuintas »

Pelo que entendi do texto é isso mesmo que voce quer.

Se no servidor é pasta \leto\lojas\lojaxx

Vai configurar o servidor como \leto\lojas

E no terminal vai usar path lojaxx ou \lojaxx

É o que o texto diz, a posição vai ser relativa à pasta configurada no leto, que passou a ser a raiz enxergada pelo terminal.
Faça o teste com e sem a barra.
Aí só precisaria desse leto_SetPath(), sem precisar mexer em todos os fontes.

Confirme o que acontece numa reconexão e/ou em mais terminais ou até no mesmo terminal com o aplicativo aberto várias vezes.
É bom pra não ter surpresas depois.

Nota: não inventariam leto_SetPath() se não fosse pra algo assim.
José M. C. Quintas
Harbour 3.2, mingw, gtwvg mt, fivewin 25.04, multithread, dbfcdx, MySQL, ADOClass, PDFClass, SefazClass, (hwgui mt), (hmg3), (hmg extended), (oohg), PNotepad, ASP, stored procedure, stored function, Linux (Flagship/harbour 3.2)
"The world is full of kings and queens, who blind our eyes and steal our dreams Its Heaven and Hell"

https://github.com/JoseQuintas/
Responder