Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > Varios
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 21-12-2005
Avatar de Coco_jac
Coco_jac Coco_jac is offline
Miembro
 
Registrado: mar 2005
Ubicación: Lima Peru
Posts: 338
Poder: 20
Coco_jac Va por buen camino
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.

Última edición por Coco_jac fecha: 21-12-2005 a las 20:28:53.
Responder Con Cita
  #2  
Antiguo 21-12-2005
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Poder: 10
marcoszorrilla Va por buen camino
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.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita
  #3  
Antiguo 21-12-2005
Avatar de Coco_jac
Coco_jac Coco_jac is offline
Miembro
 
Registrado: mar 2005
Ubicación: Lima Peru
Posts: 338
Poder: 20
Coco_jac Va por buen camino
Hola marcos gracias por responder, me podrias explicar un poco el ultimo punto no me queda claro


gracias.
Responder Con Cita
  #4  
Antiguo 21-12-2005
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Poder: 10
marcoszorrilla Va por buen camino
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.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita
  #5  
Antiguo 21-12-2005
Avatar de Coco_jac
Coco_jac Coco_jac is offline
Miembro
 
Registrado: mar 2005
Ubicación: Lima Peru
Posts: 338
Poder: 20
Coco_jac Va por buen camino
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.
Responder Con Cita
  #6  
Antiguo 22-12-2005
Avatar de marcoszorrilla
marcoszorrilla marcoszorrilla is offline
Capo
 
Registrado: may 2003
Ubicación: Cantabria - España
Posts: 11.221
Poder: 10
marcoszorrilla Va por buen camino
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.
__________________
Guía de Estilo de los Foros
Cita:
- Ça c'est la caisse. Le mouton que tu veux est dedans.
Responder Con Cita
Respuesta



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro


La franja horaria es GMT +2. Ahora son las 21:43:02.


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
Copyright 1996-2007 Club Delphi