@@ -24,6 +24,8 @@ public class DriverFactory : SqlDriverFactory
2424 {
2525 private const string DatabaseAndSchemaQuery = "select current_database(), current_schema()" ;
2626
27+ private readonly static Guid InstanceIdentifier ;
28+
2729 private readonly static bool InfinityAliasForDatesEnabled ;
2830 private readonly static bool LegacyTimestamptBehaviorEnabled ;
2931
@@ -242,7 +244,7 @@ private static System.IO.TextWriter CreateFile(string switchName)
242244 var buildConfigFolder = libFolder . Parent ; //Debug/Release
243245
244246 var tempFilesFolder = buildConfigFolder . CreateSubdirectory ( dotnetName ) ;
245- var fileToWrite = System . IO . File . CreateText ( System . IO . Path . Combine ( tempFilesFolder . FullName , $ "Switch_{ switchName . Replace ( '.' , '_' ) } _{ Guid . NewGuid ( ) } .log") ) ;
247+ var fileToWrite = System . IO . File . CreateText ( System . IO . Path . Combine ( tempFilesFolder . FullName , $ "Switch_{ switchName . Replace ( '.' , '_' ) } _{ InstanceIdentifier } .log") ) ;
246248 return fileToWrite ;
247249 }
248250
@@ -261,14 +263,16 @@ private static System.IO.TextWriter CreateFile()
261263 var buildConfigFolder = libFolder . Parent ; //Debug/Release
262264
263265 var tempFilesFolder = buildConfigFolder . CreateSubdirectory ( dotnetName ) ;
264- var fileToWrite = System . IO . File . CreateText ( System . IO . Path . Combine ( tempFilesFolder . FullName , $ "CtorCall_{ Guid . NewGuid ( ) } .log") ) ;
266+ var fileToWrite = System . IO . File . CreateText ( System . IO . Path . Combine ( tempFilesFolder . FullName , $ "CtorCall_{ InstanceIdentifier } .log") ) ;
265267 return fileToWrite ;
266268 }
267269
268270 #endregion
269271
270272 static DriverFactory ( )
271273 {
274+ InstanceIdentifier = Guid . NewGuid ( ) ;
275+
272276 // Starting from Npgsql 6.0 they broke compatibility by forcefully replacing
273277 // DateTime.MinValue/MaxValue in parameters with -Infinity and Infinity values.
274278 // This new "feature", though doesn't affect reading/writing of values and equality/inequality
0 commit comments