diff --git a/Database.Cached/Database.Cached.vbproj b/Database.Cached/Database.Cached.vbproj
new file mode 100644
index 00000000..31796d23
--- /dev/null
+++ b/Database.Cached/Database.Cached.vbproj
@@ -0,0 +1,129 @@
+
+
+
+
+ Debug
+ AnyCPU
+ {E0DC883D-FAE1-4103-B2BA-043EBE697B09}
+ Library
+ Database.Cached
+ Database.Cached
+ 512
+ Windows
+ v4.6.1
+ true
+
+
+ true
+ full
+ true
+ true
+ bin\Debug\
+ Database.Cached.xml
+ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
+
+
+ pdbonly
+ false
+ true
+ true
+ bin\Release\
+ Database.Cached.xml
+ 42016,41999,42017,42018,42019,42032,42036,42020,42021,42022
+
+
+ On
+
+
+ Binary
+
+
+ Off
+
+
+ On
+
+
+
+
+ ..\packages\NLog.4.7.5\lib\net45\NLog.dll
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ True
+ Application.myapp
+
+
+ True
+ True
+ Resources.resx
+
+
+ True
+ Settings.settings
+ True
+
+
+
+
+ VbMyResourcesResXFileCodeGenerator
+ Resources.Designer.vb
+ My.Resources
+ Designer
+
+
+
+
+
+ MyApplicationCodeGenerator
+ Application.Designer.vb
+
+
+ SettingsSingleFileGenerator
+ My
+ Settings.Designer.vb
+
+
+
+
+
+ {eaf0ea75-5fa7-485d-89c7-b2d843b03a96}
+ Database
+
+
+ {25017513-0d97-49d3-98d7-ba76d9b251b0}
+ EDMI.API
+
+
+ {903b2d7d-3b80-4be9-8713-7447b704e1b0}
+ Logging
+
+
+
+
\ No newline at end of file
diff --git a/Database.Cached/MSSQLServerCached.vb b/Database.Cached/MSSQLServerCached.vb
new file mode 100644
index 00000000..aa726bdf
--- /dev/null
+++ b/Database.Cached/MSSQLServerCached.vb
@@ -0,0 +1,63 @@
+Imports DigitalData.Modules.Database
+Imports DigitalData.Modules.EDMI.API
+Imports DigitalData.Modules.EDMI.API.EDMIServiceReference
+Imports DigitalData.Modules.Logging
+
+Public Class MSSQLServerCached
+ Private _Logger As Logger
+ Private _Client As Client
+ Private _DatabaseEDM As MSSQLServer
+ Private _DatabaseIDB As MSSQLServer
+ Private _Type As DatabaseType
+
+ Public Enum DatabaseType
+ ECM
+ IDB
+ End Enum
+
+ Public Sub New(LogConfig As LogConfig, Client As Client, DatabaseECM As MSSQLServer, DatabaseIDB As MSSQLServer)
+ _Logger = LogConfig.GetLogger()
+ _Client = Client
+ _DatabaseEDM = DatabaseECM
+ _DatabaseIDB = DatabaseIDB
+ End Sub
+
+ Public Function GetDatatable(DataTable As String, FilterExpression As String, SortByColumn As String, FallbackSQL As String, FallbackType As DatabaseType, Optional ForceFallback As Boolean = False) As DataTable
+ Try
+ Dim oResult As DataTable = Nothing
+
+ If ForceFallback = False Then
+ Dim oTableResult As TableResult = _Client.GetDatatableByName(DataTable, FilterExpression, SortByColumn)
+
+ If oTableResult Is Nothing OrElse oTableResult.OK = False Then
+ _Logger.Warn("Datatable [{0}] could not be fetched from AppServer Cache. Falling back to direct Database Access.")
+ End If
+ Else
+ Return GetDatatableFromDatabase(FallbackSQL, FallbackType)
+ End If
+ Catch ex As Exception
+ _Logger.Error(ex)
+ Return Nothing
+ End Try
+ End Function
+
+ Private Function GetDatatableFromDatabase(SQLCommand As String, DatabaseType As DatabaseType)
+ Try
+ Select Case DatabaseType
+ Case DatabaseType.ECM
+ Return _DatabaseEDM.GetDatatable(SQLCommand)
+
+ Case DatabaseType.IDB
+ Return _DatabaseIDB.GetDatatable(SQLCommand)
+
+ Case Else
+ Return Nothing
+
+ End Select
+ Catch ex As Exception
+ _Logger.Error(ex)
+ Return Nothing
+
+ End Try
+ End Function
+End Class
diff --git a/Database.Cached/My Project/Application.Designer.vb b/Database.Cached/My Project/Application.Designer.vb
new file mode 100644
index 00000000..88dd01c7
--- /dev/null
+++ b/Database.Cached/My Project/Application.Designer.vb
@@ -0,0 +1,13 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
diff --git a/Database.Cached/My Project/Application.myapp b/Database.Cached/My Project/Application.myapp
new file mode 100644
index 00000000..758895de
--- /dev/null
+++ b/Database.Cached/My Project/Application.myapp
@@ -0,0 +1,10 @@
+
+
+ false
+ false
+ 0
+ true
+ 0
+ 1
+ true
+
diff --git a/Database.Cached/My Project/AssemblyInfo.vb b/Database.Cached/My Project/AssemblyInfo.vb
new file mode 100644
index 00000000..f8ceccac
--- /dev/null
+++ b/Database.Cached/My Project/AssemblyInfo.vb
@@ -0,0 +1,35 @@
+Imports System
+Imports System.Reflection
+Imports System.Runtime.InteropServices
+
+' Allgemeine Informationen über eine Assembly werden über die folgenden
+' Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
+' die einer Assembly zugeordnet sind.
+
+' Werte der Assemblyattribute überprüfen
+
+
+
+
+
+
+
+
+
+
+'Die folgende GUID wird für die typelib-ID verwendet, wenn dieses Projekt für COM verfügbar gemacht wird.
+
+
+' Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
+'
+' Hauptversion
+' Nebenversion
+' Buildnummer
+' Revision
+'
+' Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
+' indem Sie "*" wie unten gezeigt eingeben:
+'
+
+
+
diff --git a/Database.Cached/My Project/Resources.Designer.vb b/Database.Cached/My Project/Resources.Designer.vb
new file mode 100644
index 00000000..e2c884da
--- /dev/null
+++ b/Database.Cached/My Project/Resources.Designer.vb
@@ -0,0 +1,62 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My.Resources
+
+ 'This class was auto-generated by the StronglyTypedResourceBuilder
+ 'class via a tool like ResGen or Visual Studio.
+ 'To add or remove a member, edit your .ResX file then rerun ResGen
+ 'with the /str option, or rebuild your VS project.
+ '''
+ ''' A strongly-typed resource class, for looking up localized strings, etc.
+ '''
+ _
+ Friend Module Resources
+
+ Private resourceMan As Global.System.Resources.ResourceManager
+
+ Private resourceCulture As Global.System.Globalization.CultureInfo
+
+ '''
+ ''' Returns the cached ResourceManager instance used by this class.
+ '''
+ _
+ Friend ReadOnly Property ResourceManager() As Global.System.Resources.ResourceManager
+ Get
+ If Object.ReferenceEquals(resourceMan, Nothing) Then
+ Dim temp As Global.System.Resources.ResourceManager = New Global.System.Resources.ResourceManager("Database.Cached.Resources", GetType(Resources).Assembly)
+ resourceMan = temp
+ End If
+ Return resourceMan
+ End Get
+ End Property
+
+ '''
+ ''' Overrides the current thread's CurrentUICulture property for all
+ ''' resource lookups using this strongly typed resource class.
+ '''
+ _
+ Friend Property Culture() As Global.System.Globalization.CultureInfo
+ Get
+ Return resourceCulture
+ End Get
+ Set(ByVal value As Global.System.Globalization.CultureInfo)
+ resourceCulture = value
+ End Set
+ End Property
+ End Module
+End Namespace
diff --git a/Database.Cached/My Project/Resources.resx b/Database.Cached/My Project/Resources.resx
new file mode 100644
index 00000000..af7dbebb
--- /dev/null
+++ b/Database.Cached/My Project/Resources.resx
@@ -0,0 +1,117 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/Database.Cached/My Project/Settings.Designer.vb b/Database.Cached/My Project/Settings.Designer.vb
new file mode 100644
index 00000000..2732f8e9
--- /dev/null
+++ b/Database.Cached/My Project/Settings.Designer.vb
@@ -0,0 +1,73 @@
+'------------------------------------------------------------------------------
+'
+' This code was generated by a tool.
+' Runtime Version:4.0.30319.42000
+'
+' Changes to this file may cause incorrect behavior and will be lost if
+' the code is regenerated.
+'
+'------------------------------------------------------------------------------
+
+Option Strict On
+Option Explicit On
+
+
+Namespace My
+
+ _
+ Partial Friend NotInheritable Class MySettings
+ Inherits Global.System.Configuration.ApplicationSettingsBase
+
+ Private Shared defaultInstance As MySettings = CType(Global.System.Configuration.ApplicationSettingsBase.Synchronized(New MySettings), MySettings)
+
+#Region "My.Settings Auto-Save Functionality"
+#If _MyType = "WindowsForms" Then
+ Private Shared addedHandler As Boolean
+
+ Private Shared addedHandlerLockObject As New Object
+
+ _
+ Private Shared Sub AutoSaveSettings(ByVal sender As Global.System.Object, ByVal e As Global.System.EventArgs)
+ If My.Application.SaveMySettingsOnExit Then
+ My.Settings.Save()
+ End If
+ End Sub
+#End If
+#End Region
+
+ Public Shared ReadOnly Property [Default]() As MySettings
+ Get
+
+#If _MyType = "WindowsForms" Then
+ If Not addedHandler Then
+ SyncLock addedHandlerLockObject
+ If Not addedHandler Then
+ AddHandler My.Application.Shutdown, AddressOf AutoSaveSettings
+ addedHandler = True
+ End If
+ End SyncLock
+ End If
+#End If
+ Return defaultInstance
+ End Get
+ End Property
+ End Class
+End Namespace
+
+Namespace My
+
+ _
+ Friend Module MySettingsProperty
+
+ _
+ Friend ReadOnly Property Settings() As Global.Database.Cached.My.MySettings
+ Get
+ Return Global.Database.Cached.My.MySettings.Default
+ End Get
+ End Property
+ End Module
+End Namespace
diff --git a/Database.Cached/My Project/Settings.settings b/Database.Cached/My Project/Settings.settings
new file mode 100644
index 00000000..85b890b3
--- /dev/null
+++ b/Database.Cached/My Project/Settings.settings
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/Database.Cached/app.config b/Database.Cached/app.config
new file mode 100644
index 00000000..d5fed9f7
--- /dev/null
+++ b/Database.Cached/app.config
@@ -0,0 +1,11 @@
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/Database.Cached/packages.config b/Database.Cached/packages.config
new file mode 100644
index 00000000..6f6bc401
--- /dev/null
+++ b/Database.Cached/packages.config
@@ -0,0 +1,4 @@
+
+
+
+
\ No newline at end of file