Jump to content
dkounal

TFDMemTable in use by different threads

Recommended Posts

I have to update an application that has 20 threads running at the same time and each thread is requesting an XML through an http connection. In order to process the received XML, each thread has to use data from 14 TFDMemtables. The Threads are the same running all the time and the TFDMemtables they use are also the same, The TFDMemTables' data are static, received from an external database when application starts, not need to be updated/edited as the application runs.

I read that with TFDMemTable you can use clonecursor and have different TFDMemTable object instances with the same data. I though that I could create such a TFDMemTable for each thread before threads start to use them.

 

My question: Can different threads use TFDMemTables object instances (created with data from clonecursor) from an initial TFDMemTable? Is this threadsafe?

 

Thank you in advace

Share this post


Link to post
21 hours ago, dkounal said:

Can different threads use TFDMemTables object instances (created with data from clonecursor) from an initial TFDMemTable? Is this threadsafe?

Yes. Moving the cursor in a clone does not affect the other clones.

 

5 hours ago, Lachlan Gemmell said:

Back in 2014 the lead architect of FireDAC confirmed it is not threadsafe.

As I read that post read access to a cloned dataset is thread safe.

  • Like 1

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×