System.Data.SQLite

Check-in [060be38247]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Cache the XML file name used by the configuration subsystem.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 060be3824767ba4134f506f0dd3d2a63b3c64fe7
User & Date: mistachkin 2017-05-11 04:06:00.444
References
2017-05-11
15:48
Cherrypick of [92f1a8d6b95e5c0d], [2621aa6f2e116d71], [060be3824767ba41], and [4fdd8dee13b40da2], cache the assembly directory and XML configuration file name. check-in: defe7832c2 user: mistachkin tags: branch-1.0.105
Context
2017-05-11
15:48
Cherrypick of [92f1a8d6b95e5c0d], [2621aa6f2e116d71], [060be3824767ba41], and [4fdd8dee13b40da2], cache the assembly directory and XML configuration file name. check-in: defe7832c2 user: mistachkin tags: branch-1.0.105
15:21
Update tests and suite helper library to account for caching of the XML configuration file name. check-in: 4fdd8dee13 user: mistachkin tags: trunk
04:06
Cache the XML file name used by the configuration subsystem. check-in: 060be38247 user: mistachkin tags: trunk
01:45
Add a missing '#if DEBUG' in the DebugData class. check-in: 2621aa6f2e user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to Doc/Extra/Provider/version.html.
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    <div id="mainBody">
    <h1 class="heading">Version History</h1>
    <p><b>1.0.106.0 - June XX, 2017 <font color="red">(release scheduled)</font></b></p>
    <ul>
      <li>Updated to <a href="https://www.sqlite.org/draft/releaselog/3_19_0.html">SQLite 3.19.0</a>.</li>
      <li>Prevent culture settings from negatively impacting integer connection string defaults.</li>
      <li>Make sure the &quot;No_SQLiteConnectionNewParser&quot; and &quot;DefaultFlags_SQLiteConnection&quot; setting values end up being cached.</li>
      <li>Cache the assembly directory used by the configuration subsystem.</li>
    </ul>
    <p><b>1.0.105.0 - April 9, 2017</b></p>
    <ul>
      <li>Updated to <a href="https://www.sqlite.org/releaselog/3_18_0.html">SQLite 3.18.0</a>.</li>
      <li>Add experimental support for native sha1 extension.</li>
    </ul>
    <p><b>1.0.104.0 - December 16, 2016</b></p>







|







44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
    <div id="mainBody">
    <h1 class="heading">Version History</h1>
    <p><b>1.0.106.0 - June XX, 2017 <font color="red">(release scheduled)</font></b></p>
    <ul>
      <li>Updated to <a href="https://www.sqlite.org/draft/releaselog/3_19_0.html">SQLite 3.19.0</a>.</li>
      <li>Prevent culture settings from negatively impacting integer connection string defaults.</li>
      <li>Make sure the &quot;No_SQLiteConnectionNewParser&quot; and &quot;DefaultFlags_SQLiteConnection&quot; setting values end up being cached.</li>
      <li>Cache the XML file name and assembly directory used by the configuration subsystem.</li>
    </ul>
    <p><b>1.0.105.0 - April 9, 2017</b></p>
    <ul>
      <li>Updated to <a href="https://www.sqlite.org/releaselog/3_18_0.html">SQLite 3.18.0</a>.</li>
      <li>Add experimental support for native sha1 extension.</li>
    </ul>
    <p><b>1.0.104.0 - December 16, 2016</b></p>
Changes to System.Data.SQLite/UnsafeNativeMethods.cs.
686
687
688
689
690
691
692








693
694
695
696
697
698
699
      /////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// This is the cached return value from the
      /// <see cref="GetAssemblyDirectory" /> method -OR- null if that method
      /// has never returned a valid value.
      /// </summary>
      private static string cachedAssemblyDirectory;








      #endregion

      /////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// For now, this method simply calls the Initialize method.
      /// </summary>
      static UnsafeNativeMethods()







>
>
>
>
>
>
>
>







686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
      /////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// This is the cached return value from the
      /// <see cref="GetAssemblyDirectory" /> method -OR- null if that method
      /// has never returned a valid value.
      /// </summary>
      private static string cachedAssemblyDirectory;

      /////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// This is the cached return value from the
      /// <see cref="GetXmlConfigFileName" /> method -OR- null if that method
      /// has never returned a valid value.
      /// </summary>
      private static string cachedXmlConfigFileName;
      #endregion

      /////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// For now, this method simply calls the Initialize method.
      /// </summary>
      static UnsafeNativeMethods()
821
822
823
824
825
826
827


















































828
829
830
831
832
833
834
835
836






837
838
839
840
841
842
843
844






845

846
847
848
849
850
851






852

853
854
855
856
857
858
859
              else
                  return null;
          }
      }

      /////////////////////////////////////////////////////////////////////////
      /// <summary>


















































      /// Queries and returns the XML configuration file name for the assembly
      /// containing the managed System.Data.SQLite components.
      /// </summary>
      /// <returns>
      /// The XML configuration file name -OR- null if it cannot be determined
      /// or does not exist.
      /// </returns>
      private static string GetXmlConfigFileName()
      {






          string directory;
          string fileName;

#if !PLATFORM_COMPACTFRAMEWORK
          directory = AppDomain.CurrentDomain.BaseDirectory;
          fileName = MaybeCombinePath(directory, XmlConfigFileName);

          if (File.Exists(fileName))






              return fileName;

#endif

          directory = GetCachedAssemblyDirectory();
          fileName = MaybeCombinePath(directory, XmlConfigFileName);

          if (File.Exists(fileName))






              return fileName;


          return null;
      }

      /////////////////////////////////////////////////////////////////////////

      /// <summary>







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>









>
>
>
>
>
>








>
>
>
>
>
>

>






>
>
>
>
>
>

>







829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
              else
                  return null;
          }
      }

      /////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// Resets the cached XML configuration file name value, thus forcing the
      /// next call to <see cref="GetCachedXmlConfigFileName" /> method to rely
      /// upon the <see cref="GetXmlConfigFileName" /> method to fetch the
      /// XML configuration file name.
      /// </summary>
      private static void ResetCachedXmlConfigFileName()
      {
          #region Debug Build Only
#if DEBUG
          DebugData.IncrementOtherCount("Method_ResetCachedXmlConfigFileName");
#endif
          #endregion

          lock (staticSyncRoot)
          {
              cachedXmlConfigFileName = null;
          }
      }

      /////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// Queries and returns the cached XML configuration file name for the
      /// assembly containing the managed System.Data.SQLite components, if
      /// available.  If the cached XML configuration file name value is not
      /// available, the <see cref="GetXmlConfigFileName" /> method will
      /// be used to obtain the XML configuration file name.
      /// </summary>
      /// <returns>
      /// The XML configuration file name -OR- null if it cannot be determined
      /// or does not exist.
      /// </returns>
      private static string GetCachedXmlConfigFileName()
      {
          #region Debug Build Only
#if DEBUG
          DebugData.IncrementOtherCount("Method_GetCachedXmlConfigFileName");
#endif
          #endregion

          lock (staticSyncRoot)
          {
              if (cachedXmlConfigFileName != null)
                  return cachedXmlConfigFileName;
          }

          return GetXmlConfigFileName();
      }

      /////////////////////////////////////////////////////////////////////////
      /// <summary>
      /// Queries and returns the XML configuration file name for the assembly
      /// containing the managed System.Data.SQLite components.
      /// </summary>
      /// <returns>
      /// The XML configuration file name -OR- null if it cannot be determined
      /// or does not exist.
      /// </returns>
      private static string GetXmlConfigFileName()
      {
          #region Debug Build Only
#if DEBUG
          DebugData.IncrementOtherCount("Method_GetXmlConfigFileName");
#endif
          #endregion

          string directory;
          string fileName;

#if !PLATFORM_COMPACTFRAMEWORK
          directory = AppDomain.CurrentDomain.BaseDirectory;
          fileName = MaybeCombinePath(directory, XmlConfigFileName);

          if (File.Exists(fileName))
          {
              lock (staticSyncRoot)
              {
                  cachedXmlConfigFileName = fileName;
              }

              return fileName;
          }
#endif

          directory = GetCachedAssemblyDirectory();
          fileName = MaybeCombinePath(directory, XmlConfigFileName);

          if (File.Exists(fileName))
          {
              lock (staticSyncRoot)
              {
                  cachedXmlConfigFileName = fileName;
              }

              return fileName;
          }

          return null;
      }

      /////////////////////////////////////////////////////////////////////////

      /// <summary>
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
          DebugData.IncrementSettingReadCount(name, true);
#endif
          #endregion

          /////////////////////////////////////////////////////////////////////

          return GetSettingValueViaXmlConfigFile(
              GetXmlConfigFileName(), name, @default, expand);
      }

      /////////////////////////////////////////////////////////////////////////

#if !PLATFORM_COMPACTFRAMEWORK
      private static string ListToString(IList<string> list)
      {







|







1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
          DebugData.IncrementSettingReadCount(name, true);
#endif
          #endregion

          /////////////////////////////////////////////////////////////////////

          return GetSettingValueViaXmlConfigFile(
              GetCachedXmlConfigFileName(), name, @default, expand);
      }

      /////////////////////////////////////////////////////////////////////////

#if !PLATFORM_COMPACTFRAMEWORK
      private static string ListToString(IList<string> list)
      {
Changes to readme.htm.
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<p>
    <b>1.0.106.0 - June XX, 2017 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Updated to <a href="https://www.sqlite.org/draft/releaselog/3_19_0.html">SQLite 3.19.0</a>.</li>
    <li>Prevent culture settings from negatively impacting integer connection string defaults.</li>
    <li>Make sure the &quot;No_SQLiteConnectionNewParser&quot; and &quot;DefaultFlags_SQLiteConnection&quot; setting values end up being cached.</li>
    <li>Cache the assembly directory used by the configuration subsystem.</li>
</ul>
<p>
    <b>1.0.105.0 - April 9, 2017</b>
</p>
<ul>
    <li>Updated to <a href="https://www.sqlite.org/releaselog/3_18_0.html">SQLite 3.18.0</a>.</li>
    <li>Add experimental support for native sha1 extension.</li>







|







210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
<p>
    <b>1.0.106.0 - June XX, 2017 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Updated to <a href="https://www.sqlite.org/draft/releaselog/3_19_0.html">SQLite 3.19.0</a>.</li>
    <li>Prevent culture settings from negatively impacting integer connection string defaults.</li>
    <li>Make sure the &quot;No_SQLiteConnectionNewParser&quot; and &quot;DefaultFlags_SQLiteConnection&quot; setting values end up being cached.</li>
    <li>Cache the XML file name and assembly directory used by the configuration subsystem.</li>
</ul>
<p>
    <b>1.0.105.0 - April 9, 2017</b>
</p>
<ul>
    <li>Updated to <a href="https://www.sqlite.org/releaselog/3_18_0.html">SQLite 3.18.0</a>.</li>
    <li>Add experimental support for native sha1 extension.</li>
Changes to www/news.wiki.
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<p>
    <b>1.0.106.0 - June XX, 2017 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Updated to [https://www.sqlite.org/draft/releaselog/3_19_0.html|SQLite 3.19.0].</li>
    <li>Prevent culture settings from negatively impacting integer connection string defaults.</li>
    <li>Make sure the &quot;No_SQLiteConnectionNewParser&quot; and &quot;DefaultFlags_SQLiteConnection&quot; setting values end up being cached.</li>
    <li>Cache the assembly directory used by the configuration subsystem.</li>
</ul>
<p>
    <b>1.0.105.0 - April 9, 2017</b>
</p>
<ul>
    <li>Updated to [https://www.sqlite.org/releaselog/3_18_0.html|SQLite 3.18.0].</li>
    <li>Add experimental support for native sha1 extension.</li>







|







47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<p>
    <b>1.0.106.0 - June XX, 2017 <font color="red">(release scheduled)</font></b>
</p>
<ul>
    <li>Updated to [https://www.sqlite.org/draft/releaselog/3_19_0.html|SQLite 3.19.0].</li>
    <li>Prevent culture settings from negatively impacting integer connection string defaults.</li>
    <li>Make sure the &quot;No_SQLiteConnectionNewParser&quot; and &quot;DefaultFlags_SQLiteConnection&quot; setting values end up being cached.</li>
    <li>Cache the XML file name and assembly directory used by the configuration subsystem.</li>
</ul>
<p>
    <b>1.0.105.0 - April 9, 2017</b>
</p>
<ul>
    <li>Updated to [https://www.sqlite.org/releaselog/3_18_0.html|SQLite 3.18.0].</li>
    <li>Add experimental support for native sha1 extension.</li>