Does .NET connection pooling affect RAND calls?

The T-SQL RAND function is documented to continue the sequence from the original seed value for the same database connection.

For example, if you open a new window in SSMS and run select rand(7),rand(),rand() and then in a separate query (but the same window and therefore the same connection) run select rand(),rand(),rand() , take note of all six values. Repeat the two calls in the same order to see that the exact same values are generated, proving that the original seed value of 7 determines the latter 3 random results, even though they're run as a separate statement, because they're run on the same connection.

I was wondering if this could impact seemingly separate calls in the .NET framework because of connection pooling. For example, if 3 hackers with 3 mobile devices each made a server call in quick succession to pick a random raffle number, and .NET used the same connection for all three, and the users were able to identify the whole sequence from those 3 numbers (being familiar with the implementation of RAND), then could they predict additional numbers that may subsequently be generated for other users in different regions because of how RAND is tied to the same connection in the connection pool? Or, does .NET reset pooled connections between calls in some way that actually resets the RAND seed when one is not specified.

(I don't use RAND, I use crypt_gen_random, so this is a purely academic question).

链接地址: http://www.djcxy.com/p/68038.html

上一篇: 寻找rand()函数的种子TI

下一篇: .NET连接池是否会影响RAND调用?