I think you have a bug in the way how tAureliusConnection.CreateConnection creates a new instance of "AdaptedConnection" = tEDBDatabase.
The tEDBDatabase is not threadsafe > For each Thread you need to create a new tEDBSession and assign this to the new tEDBDatabase component.
... or I'm missing something?
wlandgraf
(Wagner Landgraf)
January 15, 2025, 10:30pm
2
TEDBDatabase is not thread-safe and is being replicated for each CreateConnection call. Are you sure TEDBSession is not thread-safe?
100%! You need one tEDBSession per Thread!
wlandgraf
(Wagner Landgraf)
January 16, 2025, 1:13pm
4
In this case you can create a separate data module with your connection components (TEDBDatabase, TEDBSession), properly configured.
Then you set:
AureliusConnection1.CloningMode := TCloningMode.Owner;
This will tell Aurelius that for each new connection, instead of duplicating the TEDBDatabase
component, it will clone the entire data module it belongs to, so TEDBSession
will also be cloned.
Very good news. Can I leave the AureliusConnection within same Datamodule where TEDBDatabase and TEDBSession is located?
wlandgraf
(Wagner Landgraf)
January 16, 2025, 5:12pm
6
Yes, but the TAureliusConnection component will also be cloned.