|
Cache Storage for Recordset :: Article - 2eNetWorX
|
|||
| 2eNetWorX :: ASP, VB, Asp.Net, Vb.Net, C#, dotNet, .Net OpenSource Projects |
| MyDev | What's New | Projects | Tutorials & Articles | Services | Stats | Contact Us |
| Guest-01422 | /dev :: home :: articles :: Caching Recorsets | 252 online visitors |
» Contributions
» Recordset Cache » OpenSource » Statisticus » OpenCYA!
» Undocumented... » Ask For Login » DSN'less Connection » Who's Online? » (All Samples)
|
Improving Database Performance by Caching serialized Recordsetsby Hakan Eskici Part 1 - Key Features and DesignPart 2 - Cache Storage and Implementation Part 3 - GetRecordset Function Part 4 - Cache Expiration and Removal Part 5 - Using the Cache Engine in your Projects Part 6 - Case Study and Final Words Cache Storage
Having proposed the interface of our Cache class, we now make use of
the global.asa file for our internal storage.
<Object Runat="Server" Scope="application" ID="dDataCache" ProgID="Scripting.Dictionary"></Object>Here, we tell the Asp engine that we would like to have a global dictionary object with name "dDataCache". We can access this object from any of our Asp pages later on. If there is no global.asa file on your site, you can simply create an empty text file and rename it to global.asa and that's it. Please note that the file must be located on the application root. (Not to mention your web site must be defined as an application). Implementation
We have a storage, and a class interface. Now it is time to implement
the features.
Class DataCache
'Connection string to connect to the database
Public ConnectionString
'Stream object for our internal use
Private stCache
'Constructor
Private Sub Class_Initialize()
Set stCache = Server.CreateObject("AdoDB.Stream")
stCache.Type = 1 'adTypeBinary
end sub
'Destructor
Private Sub Class_Terminate()
Set stCache = Nothing
End Sub
End Class
We use the AdoDB.Stream object for serialization & deserialization of
the Recordsets. Therefore we create one in the constructor.
|
Bot: Msn
echoPANEL, Free .NET
FogBugz Hosting Plans
|
| privacy policy , license , disclaimer , © 2000-2004, 2eNetWorX. [page generated in 78 ms.] |