Foros Club Delphi

Foros Club Delphi (https://www.clubdelphi.com/foros/index.php)
-   Varios (https://www.clubdelphi.com/foros/forumdisplay.php?f=11)
-   -   Proceso muy largo ? (https://www.clubdelphi.com/foros/showthread.php?t=28509)

Coco_jac 21-12-2005 20:23:20

Proceso muy largo ?
 
Hola amigos del foro, necesito nuevamente su ayuda sucede que trabajo con tablas PARADOX y tengo que trabajar con tablas del sistema , es decir pequeños modulos que utilicen esas tablas tengo un proceso el cual toma tiempo

//SQLCodigoclie2='Select cclie from clie01 where Substring(cclie from 1 for 1) between '+ chr(39)+'a'+chr(39)+ ' and '+ chr(39)+'z'+ chr(39)+' Order by cclie asc';

Tengo cerca de 13000 registro de esta consulta, lueo realizo un bucle para barrer el Recorset

pongo 800, solo para ver el tiempo , cosa que en realida no debe ir solo es para efectos de prueba

Código:

SQLquerytmp:=ObtenerSQL(SQLCodigoclie2);
indice:=0;
 
while not SQLquerytmp.Eof and (indice<=800)do
begin
Codigoclie:=SQLquerytmp.Fields[0].asstring;
SQLquery:=ObtenerSQL(SQLFindKardexclieS1+chr(39)+Codigoclie+chr(39));
        if SQLquery.RecordCount>0 then                        // Tiene movimientos
        begin
        Saldo1:=RoundTo(SQLquery.fields[0].asfloat,-2);
        Sqlquery.SQL.Clear;
        Sqlquery.Close;
        SQLquery:=ObtenerSQL(SQLFindKardexclieS2+chr(39)+Codigoclie+chr(39));
        Saldo2:=RoundTo(SQLquery.fields[0].asfloat,-2);
        if Saldo1=Saldo2 then        // No tiene saldo
                if saldo1<=350 then        // Saldo menor o igual a 350 soles
                begin
                EjecutarSQL(SQLUpdateClienteKard,'JA078',Codigoclie);                                // Actualizo Kardex de Cliente
                        SQLquery:=ObtenerSQL(SQLFindClienteMovInv+chr(39)+Codigoclie+chr(39)); // Verificar si el cliente tiene Movimientos
                        if SQLquery.RecordCount>0 then
                        EjecutarSQL(SQLUpdateClienteMovInv,'JA078',Codigoclie);                        // Actualizo Movimientos de Cliente
                        EjecutarSQL(SQLUpdateClienteFact,'JA078',Codigoclie);                                // Actualizo Facturas de Cliente
                        EjecutarSQL(SQLDeleteClie,Codigoclie);}
                end;
        end
        else
        EjecutarSQL(SQLDeleteClie,Codigoclie); // Borra al cliente de la tabla CLIE01
Sqlquery.Close;
SQLquerytmp.Next;
inc(indice);
gbar.Progress:=gbar.Progress+1;
end;
Sqlquery:=nil;
SQLquerytmp.Close;
SQLquerytmp:=nil;
end;

el problema aqui sucede que si pongo menos de 700 todo sale bien , pero cuando pongo 800 o mas sale un mesaje que dice:
LOCK FILR HAS GROWN TOO LARGE
A que se puede deber esto , ya que en realidad el recorrido total esta mas o menos 13000 veces
Espero sus comentarios.

marcoszorrilla 21-12-2005 20:51:37

Leete esto:
Cita:

Removing "Lock file has grown too large" Error - by Borland Developer Support Staff

Technical Information Database

TI256B.txt Removing "Lock file has grown too large" Error
Category :General Programming
Platform :All
Product :BDE All

Description:
Lock file has grown too large, Decimal:9495 Hex:2517
----------------------------------------------------
This problem is specific to Paradox tables and can be caused
in any BDE (16 or 32 Bit) application that meet some or all
of the following criteria:

1) The Executable is in the same directory as the table.
2) The Private Directory is not correctly set or not set
at all.
3a) Delphi: Having a TTable open on a paradox table and
then performing multiple TQuery operations.
3b) C / C++: Having a table open with DbiOpenTable and
then performing multiple queries with DbiQExec and/or
DbiQExecDirect.
4) LOCAL SHARE set to true in the BDE Configuration
Utility on the System page.


To solve the problem, make sure that your application has
done ALL of the following:

1) Under the directory where the executable is, create
three new directories: TABLES, PRIV, and NET. Place
all the tables for the application into the TABLES
directory.
2) Set the session's private directory to the PRIV
directory. Take the following steps according to
the software you are using.

DELPHI:
Session.PrivateDir := ExtractFilePath(ParamStr(0)) + 'PRIV';

C / C++:
DbiSetPrivateDir(szPath);
// szPath is the fully qualified path (not relative)
// to the PRIV directory.

3) Set the session's network directory to the NET
directory. Take the following steps according to
the software you are using.

DELPHI:
Session.NetFileDir := ExtractFilePath(ParamStr(0)) + 'NET';

C / C++:
DbiSetProp(hSes, sesNETFILE, (UINT32)szPath);
// szPath is the fully qualified path (not relative)
// to the NET directory.

// hSes is the current session handle. This can be
// retrieved using the DBiGetCurrSession function.

4) If LOCAL SHARE is set to true and you are not sharing
tables between different applications at the same time,
change LOCAL SHARE to false.

The above steps will correct the Lock File Too Large error.
Un Saludo.

Coco_jac 21-12-2005 22:24:25

Hola marcos gracias por responder, me podrias explicar un poco el ultimo punto no me queda claro


gracias.

marcoszorrilla 21-12-2005 22:55:45

Cita:

4) If LOCAL SHARE is set to true and you are not sharing
tables between different applications at the same time,
change LOCAL SHARE to false.
Supongo que te refieres a este punto?.

Pues lo que dice es que configures Local Share a False, sino compartes las tablas entre diferentes aplicaciones.

Un ejemplo creas en Delphi con Tablas Paradox un programa de facturación, otro de contabilidad y otro de nóminas, por ejemplo la tabla clientes es la misma para facturación y contabilidad, por lo tanto si se abre la contabilidad y la facturación a la vez, cosa más que probable, estariamos compartiendo dicha tabla a parte de otras entre 2 aplicaciones distintas, en este caso si habría que configurar Local Share a True.

Un Saludo.

Coco_jac 21-12-2005 22:57:58

Hola nuevamente Marcos, estuve leyendo con detenimiento y me quedo mas claro pero tengo una inquietud, te explico, la causa de mi problema es el punto 2 :

Delphi: Hay una componente TTable abierta asociada a
una tabla sobre la cual se realizan múltiples consultas SQL
mediante una componente TQuery.


pero mi aplicacion correra en cada maquina, y no desde el servidor donde si estan alojadas mi tablas, como solucionaria esto, ya que se especifica que debo crear las carpetas y direccionarlas a ellas.

marcoszorrilla 22-12-2005 21:54:59

La estructura suele ser:
\\Servidor\c:\Programa
\\Servidor\C:\Programa\Tablas
\\Servidor\C:\programa\Net

Configuras el Alias y el NetDir y ya lo tienes.

Un Saludo.


La franja horaria es GMT +2. Ahora son las 04:48:13.

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi