Title


Any one has the same problem with IBLite?

When a TFDQuery component executes certain queries, FireDAC return the next error message:

[FireDAC][Phys][IBLite]I/O error for file ""
Error while trying to open file
No such file or directory.
sort error

If I deploy as "Normal" the program works well. Is in "App Store" (sandboxed) mode when the problems arise.

And they only occurs in IBLite, and in MacOS.
Not tested on  IBTogo, and Mobile Platforms.

And these are the steps to reproduce the problem:

Create a new project and in Deployment, prepare it for App Store (Deploy), with IBLite. Include SANDBOX.IB file.

Add a TFDConnection component and a TGUIxWaitCursor.
Configure the connection for connect with the Interbase DB file SANDBOX.IB (Attached with the example code).

Add a TFDQuery component and set his Connection property to the previously added TFDConnection component.

Assign one the the next queries, that you can found on the source code, CLIENTES, PROVEEDORES o AGENTES, to the property SQL of the TFDQuery component. (I recommend start with the query CLIENTES).

Provide two buttons and two labels in the view. One for Activate the TFDComponents, and other for Open the TFDQuery. Each label is for inform the user about the success or fail of the operation.

Now execute the program. Remember: Only fails in App Store (sandboxed) Configuration and only in OS X Target Platform.
(In the test I was not created the persistent TField components)

Push the button that open the database. This should work well.

Push the button that execute the Query:

[FireDAC][Phys][IBLite]I/O error for file ""
Error while trying to open file
No such file or directory.
sort error

I was investigating and I found the next things:

for the query:
SELECT CLI.CD_CLIENTE ,
CLI.SU_CODIGO ,
... 109 total fields
FROM CLIENTES CLI
LEFT JOIN FORMASPAGO PAG ON PAG.CD_FORMAPAGO = CLI.CD_FORMAPAGO
LEFT JOIN PRICE_SCHEMA SCH ON SCH.CD_SCHEMA = CLI.CD_SCHEMA
LEFT JOIN ACTIVIDADES ACT ON ACT.CD_ACTIVIDAD = CLI.CD_ACTIVIDAD
LEFT JOIN ZONAS ZON ON ZON.CD_ZONA = CLI.CD_ZONA
LEFT JOIN TIPOSCLIENTE TCLI ON TCLI.CD_TIPOCLIENTE = CLI.CD_TIPOCLIENTE
LEFT JOIN AGENTES AGE ON AGE.CD_AGENTE = CLI.CD_AGENTE
LEFT JOIN RUTAS RUT ON RUT.CD_RUTA = CLI.CD_RUTA
LEFT JOIN DIVISAS DIV ON DIV.CD_DIVISA = CLI.CD_DIVISA
LEFT JOIN TRANSPORTES TRA ON TRA.CD_TRANSPORTE = CLI.CD_TRANSPORTE
ORDER BY CD_CLIENTE

The Table has about 500 rows in DB and always show the error.

If I remove all the LEFT JOINS and his associated fields... Query works well!

If I left the LEFT JOINS but I remove the ORDER BY... Query works well!

If I empty the table... Query works well on all circumstances! With LEFT JOINS and with ORDER BY clauses.

I traced the FireDAC code and I find that the problem is related with the next thing:

if the next file http://docs.embarcadero.com/products/interbase/IBXE7Update1/OpGuide.pdf

In page 4-18 says

_Managing Temporary Files
InterBase creates two types of temporary files: sort files and history list files.
The InterBase server creates sort files when the size of the internal sort buffer isn’t big enough to perform the sort. Each request (for example, CONNECT or CREATE DATABASE) gets and shares the same list of temporary file directories. Each request creates its own temporary files (each has its own I/O file handle). Sort files are released when sort is finished or the request is released. If space runs out in a particular directory, InterBase creates a new temporary file in the next directory from the directory list. If there are no more entries in the directory list, it prints an error message and stops processing the current request._

This is the only reference I found about writing files when we request order from database.

I can't check the next conjecture: as say the text from abobe, when IBLite needs a bigger buffer to perform the sort, it recurres to a new file on the disk, but... have a problem with the name of this file or with the location of the same, that of course shall be create on the

Applications Container and is not.

Remember this please: All the queries runs well if the deploy is not Sandboxed (App Store).

If any one want the test project I can send-it.

Comments

  1. This sounds like a bug to me. Have you reported it to the Quality Portal (http://quality.embarcadero.com)? Are you using the latest updates (Update 3 has been released and you should be able to make it work with your license once downlaoded the trial from https://downloads.embarcadero.com/free/interbase)? Have you followed this doc: http://docwiki.embarcadero.com/RADStudio/XE8/en/App_Sandboxing_with_InterBase_ToGo_for_Mac_OS_X?

    ReplyDelete
  2. Yes. It sound like a big bug. And yes, I reported it. (RSP-11500) But the issue continues without answer or modification of his state. 

    About the App Sanboxing Guide. Yes, I followed this guide. And I discovered a bug on it. But I can't contribute in this wiki. 

    I'm going to test if I have the latests versions of IBLite. I think I have it, because I updated the system recently to XE8.1.

    I tested all the queries on MS-SQL Server, and when I add all the tables without the LEFT JOINS, the result came in the order of 20.000 rows for only about 500 that the original table has. Is this result what I think that IBLite try to store on an external file, for do with it the filtering of the LEFT JOINS. 

    But the problem seems to be, that the driver or FireDAC gives a Empty string as the file name to use. 

    Thanks!

    ReplyDelete

Post a Comment