General information
Title:
Multiple Connection to Database
Environment versions
Network:
Windows 2003 Server
Hi,
I would like to know, is it ok to have 5 different connection Handle to the same database. I will explain myself.
My connection are made
#CODE#
This.nConn1 = SQLCONNECT("SomeODBC", "User", "Pass")
This.nConn2 = SQLCONNECT("SomeODBC", "User", "Pass")
This.nConn3 = SQLCONNECT("SomeODBC", "User", "Pass")
This.nConn4 = SQLCONNECT("SomeODBC", "User", "Pass")
This.nConn5 = SQLCONNECT("SomeODBC", "User", "Pass")
#CODE#
Then a prepare a different SQL statement for each connection that I call in a loop, the result of SQL 1 is a bind variable to SQL 2 and SQL 2 to SQL3... you probably get the picture. that loop is called about 100 000 times. I see a 7-8% gain with using 5 different connections instead of only one and reissuing SQLPrepare between each call. Beleive it or not, it's a lot faster (about 900-1000% gain) doing all my joins like that (completely manual via multiple request) than sending one big SQL statement with a 5 table inner join for Oracle (The Oracle database doesn't contain any indexes, and joins are made of 2 sometime 3 fields, each tables have at least 1 million reccords).
I really like the 7-8% gain, but I know that Connection Handles are something really precious.
Please advise.
I need something that look really similar for an export, but the number of connection will be 12, is it still ok?
btw how can my code look like code inside of UT?
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only