API/CodeSamples/CacheStoredProcedureMetaDataToDisk.md
... ...
@@ -0,0 +1,54 @@
1
+#CacheStoredProcedureMetaDataToDisk
2
+
3
+[[_TOC_]]
4
+
5
+##About
6
+
7
+_**Obsolete:** This setting is no longer available as of Izenda 6.10.0.6. All database schema disk caching is handled by [[CacheSchema|/API/CodeSamples/CacheSchema]]._
8
+
9
+This setting controls whether stored procedure metadata (parameters and returned columns) is cached to the server's filesystem. When enabled, on the first call to get database schema stored procedures, each will be run to obtain the metadata and will have that data stored to the filesystem for future use until the cache expires. When disabled, every request that accesses the database schema will re-run stored procedures.
10
+
11
+**Default Value:** false
12
+
13
+##Global.asax (C♯)
14
+
15
+```csharp
16
+//main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
17
+public class CustomAdHocConfig : Izenda.AdHoc.DatabaseAdHocConfig
18
+{
19
+ // Configure settings
20
+ // Add custom settings after setting the license key and connection string by overriding the ConfigureSettings() method
21
+ public static void InitializeReporting() {
22
+ //Check to see if we've already initialized.
23
+ if (HttpContext.Current.Session == null || HttpContext.Current.Session["ReportingInitialized"] != null)
24
+ return;
25
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE";
26
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE";
27
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = new CustomAdHocConfig();
28
+ AdHocSettings.CacheStoredProcedureMetaDataToDisk = true; //The relevant setting
29
+ HttpContext.Current.Session["ReportingInitialized"] = true;
30
+ }
31
+}
32
+```
33
+
34
+##Global.asax (VB.NET)
35
+
36
+```visualbasic
37
+
38
+'main class: inherits DatabaseAdHocConfig or FileSystemAdHocConfig
39
+Public Class CustomAdHocConfig
40
+ Inherits Izenda.AdHoc.DatabaseAdHocConfig
41
+
42
+ Shared Sub InitializeReporting()
43
+ 'Check to see if we've already initialized
44
+ If HttpContext.Current.Session Is Nothing OrElse HttpContext.Current.Session("ReportingInitialized") IsNot Nothing Then
45
+ Return
46
+ 'Initialize System
47
+ AdHocSettings.LicenseKey = "INSERT_LICENSE_KEY_HERE"
48
+ AdHocSettings.SqlServerConnectionString = "INSERT_CONNECTION_STRING_HERE"
49
+ Izenda.AdHoc.AdHocSettings.AdHocConfig = New CustomAdHocConfig()
50
+ AdHocSettings.CacheStoredProcedureMetaDataToDisk = True 'The relevant setting
51
+ HttpContext.Current.Session("ReportingInitialized") = True
52
+ End Sub
53
+End Class
54
+```
... ...
\ No newline at end of file