PDA

Ver la Versión Completa : Error en Tracing and Monitoring FireDAC Dispositivos iOS


cdac901
28-10-2019, 18:33:24
Seguí estas instrucciones para verificar el monitoreo (http://docwiki.embarcadero.com/RADStudio/Rio/en/Tracing_and_Monitoring_(FireDAC)) de los sql con firedac y una base de datos sqlite, en windows funciona bien, sin embargo en iOS tengo un problema al momento de conectarse con la base de datos genera el siguiente error:

First chance exception at $000AA2D5. Exception class EFOpenError with message 'Cannot open file
"/private/var/mobile/Containers/Data/Application/CCD75E46-3C71-40F9-9F58-6B2957695294/tmp/trace1.txt".
Bad file descriptor'. Process myapp (4251838)

El código que estoy probando es este:

FMX:

object DM: TDM
OldCreateOrder = False
OnCreate = DataModuleCreate
Height = 150
Width = 436
object FDMoniFlatFileClientLink1: TFDMoniFlatFileClientLink
FileAppend = True
Left = 344
Top = 16
end
object DB: TFDConnection
Params.Strings = (
'Database=C:\myapp\db\myapp.sqlite'
'JournalMode=Persist'
'StringFormat=ANSI'
'LockingMode=Normal'
'DriverID=SQLite')
ResourceOptions.AssignedValues = [rvCmdExecMode]
UpdateOptions.AssignedValues = [uvLockMode]
LoginPrompt = False
Transaction = trn
UpdateTransaction = trn
Left = 48
Top = 16
end
object FDGUIxWaitCursor1: TFDGUIxWaitCursor
Provider = 'FMX'
Left = 64
Top = 72
end
object FDPhysSQLiteDriverLink1: TFDPhysSQLiteDriverLink
Left = 168
Top = 16
end
object trn: TFDTransaction
Connection = DB
Left = 152
Top = 88
end
object exec: TFDQuery
Connection = DB
Transaction = trn
UpdateTransaction = trn
Left = 208
Top = 88
end
end


PAS:

procedure TDM.DataModuleCreate(Sender: TObject);
begin
if DB.Connected then
DB.Connected := False;

FDMoniFlatFileClientLink1.FileName := TPath.Combine(TPath.GetTempPath, 'trace1.txt');
DB.Params.MonitorBy := mbFlatFile;
FDMoniFlatFileClientLink1.Tracing := True;

try
DB.Connected := True; //Aqui me muestra el mensaje de error
except
on E: Exception do
begin
TDialogService.PreferredMode := TDialogService.TPreferredMode.Sync;
TDialogService.MessageDialog('Problemas al conectar a la base de datos. Verifique lo siguiente: ' + e.Message, TMsgDlgType.mtWarning,
[TMsgDlgBtn.mbOK], TMsgDlgBtn.mbOk, 0, nil);
end;
end;
end;


¿Como seria la forma correcta de escribir el archivo trace1.txt dentro del dispositivo iOS?

Saludos.