Copy one TUniConnection to another TUniConnection
Posted: Thu 28 Dec 2017 10:43
Hello,
I am using Delphi 10.2.2, UniDAC 7.1.3, SQL Server 2012, SQL Server 2016 and PostgreSQL 10.1
My application can use SQL Server and PostgreSQL databases depending on user choice. Databases can be switched to another if user would like so. All connection parameters as well as some SpecificOptions are saved and loaded when application is starting.
That application at some point runs some operations in Thread. We know that each Thread require its own TUniConnection for safe operation.
My question is:
Is there a ready function/method to copy my already connected Main Application TUniConnection properties into Thread TUniConnection properties?
Please note that I do need almost identical DataModule.UniConection1 and MyThread.UniConnection1. Meaning all parameters, Options and SpecificOptions to be copied except MyThread.UniConnection1 will not be connected to database until I tell it to do so.
I am hesitating to call all these procedures for MyThread.UniConnection1 parameters to be loaded again and again from file system for each thread use.
I can implement my own copy procedure, however, I would like to learn if there is already something available.
Thanks & regards,
Ertan
I am using Delphi 10.2.2, UniDAC 7.1.3, SQL Server 2012, SQL Server 2016 and PostgreSQL 10.1
My application can use SQL Server and PostgreSQL databases depending on user choice. Databases can be switched to another if user would like so. All connection parameters as well as some SpecificOptions are saved and loaded when application is starting.
That application at some point runs some operations in Thread. We know that each Thread require its own TUniConnection for safe operation.
My question is:
Is there a ready function/method to copy my already connected Main Application TUniConnection properties into Thread TUniConnection properties?
Please note that I do need almost identical DataModule.UniConection1 and MyThread.UniConnection1. Meaning all parameters, Options and SpecificOptions to be copied except MyThread.UniConnection1 will not be connected to database until I tell it to do so.
I am hesitating to call all these procedures for MyThread.UniConnection1 parameters to be loaded again and again from file system for each thread use.
I can implement my own copy procedure, however, I would like to learn if there is already something available.
Thanks & regards,
Ertan