Create on the fly TXDataset freeze my App on Android


I'm building a remoteDB sync into my local SqLite database:

           TablaRemota := TXDataSet.Create(Nil);
           TablaRemota.Database := ConexionBD;
           TablaRemota.SQL.Add(' Select * from ' + ArregloTablas[IndiceTabla]);

Code above hangs my App, I drop a TXDataset component but same result.

Code above inside into a "For" loop, I need to sincronize several tables.

Why hangs?


I don't know. The code is rather simple. We need more info - a project reproducing the issue, or some additional info. Are you sure it's hanging or just slow?

IndiceTabla, X: Integer;
ArregloTablas: TStringList;
TablaRemota: TXDataset;
ArregloTablas := TStringList.Create;

 For IndiceTabla := 0 to ArregloTablas.Count - 1 do
      // Indicamos la tabla en Operación
      IndicadorProgreso.Message := 'Tabla ' + ArregloTablas[IndiceTabla];

      // Clonamos tablas
      TablaRemota := TXDataSet.Create(Self);
      TablaRemota.Database := ModuloDeDatos.ConexionBD; <------ Here a link to a DataModule Unit
      TablaRemota.SQL.Add(' Select * from ' + ArregloTablas[IndiceTabla]);

      // Destruimos la tabla temporal remota

 // Liberamos

Code aboves hangs on SECOND iteration, check for yourself, I mean when IndiceTabla >= 1

Again, isn't it just that table Productos is too big and taking too much time? It's not a good practice to do a raw Select * from from any database, and specially using RemoteDB.

What is the exact line that hangs?

Other than this, unfortunately we need a way to reproduce the issue at our side.

As I wrote on my first post "I'm building a remoteDB sync into my local SqLite database:"

The idea is to "send part of my database" not even the entire into my local SQLite, if your component does not support that kind of overload then it does not work for my goal.

In that case RemoteDB is a joke then, you must claim that such components only support 100 retrieved records.

I need to enable my user to be a mobile offline POS, but for that he must have the entire DB of this products and clients in his tablet or smart phone, if he manage 15000 records it's his problem not mine, I'm just giving him the solution to carry such amounts of records in order to sale products, and later upload the records to his server when arrives at the Server with some kind of Sync procedure.

My actual test with "Productos" table is about 35,000 records

I still don't know what the problem is. It can be a multitude or reasons and I can only guess.
I'm suggesting you do tests. Try to limit the number of records retrieved using SQL and see what happens. Investigation is needed.

Seems trouble is concerning to thousand records retrieved, what do you suggest?

If trouble is with more than 5000 records and my total table is about 35,000 records should I need to part it in 7 different queries?

Don't you have a timeout property wich I could increase?

However I've another table with images saved on Blob fields, total records in this table not exceed 83, so when I tried to select from an TXDataset it hangs too.

So I think trouble is concerning to some kind of cache on your side, or timeout, I don't design the components but your company does.

Yes, that's a valid approach.

Yes, it's possible, but how the timeout would help? You said the application hangs. You can set the Timeout property of TRemoteDBDatabase component:

RemoteDBDatabase1.Timeout := 60000 * 5; // 5 minutes

The more data you transfer, the longer it will take to receive and process. And the more memory it will take as well. But in any case, to properly know what's going on, of course we need to reproduce the issue. So far we were not aware of any similar issues with RemoteDB.

Today I tested on iOS, I increase timeout on my TADOConnection component [comandtimeout and connectiontimeout], however I don't think this could help anything.

Tested was okey without increase any other timeout property as you wrote me, so my problem is on Android specifically.

Best regards

The only timeout I found was on TRemoteDBServer as image above, is that correct?

It is available as public property, not published. It means it's available from code, but not from the object inspector.