ProudNet.Eng
WebsiteProud ConsoleLanguage
  • 🌐ProudNet
    • ProudNet Introduction
    • Download and Install
      • How to verify your ProudNet license
      • AMI
    • Project Settings
      • C++
      • C#
      • Mac Xcode
      • Linux
      • Unity3D
        • iOS Build
      • Unreal Engine 4
      • Running the PIDL Compiler
    • Using ProudNet
      • Server and Client
        • Utilization of Server
        • Utilization of Client
      • RMI
        • Utilization of RMI
      • PIDL
        • Utilization of PIDL
      • Event handling
      • Communication messages
      • P2P Communication
        • Using P2P communication
    • Utilization of ProudNet
      • How to use
      • Tips for performance
    • Using DB in ProudNet
      • DB Cache System ver.2
        • DB Cache Theory and Understanding
        • Install DB Cache and Set Up Network
        • DB Cache Server and Client
        • DB Cache usage and application
          • Utilization of DB Cache
      • ADO API
      • ODBC API
    • ProudNet Utility
  • ProudNet Note
    • Technical Notes
      • Main Loop
      • Setting up a server firewall
      • Encryption and decryption
      • What to do in case of an error
      • List of error messages
      • Synchronizing Character Position
      • Client-Server Communication
      • MiniDump (Error Dump System)
      • [Version 1.6] Server-to-Server LAN Communicator
    • Glossary
    • Sample examples
  • 🌐Proud Service
    • Guide for Console
    • ProudChat
      • Download SDK
        • C++
        • C#
        • Unity3D
        • Unreal Engine 4
      • Features in Console
Powered by GitBook
On this page
  • Mixing ADO with the ProudNet DB cache system
  • Adjusting DB cache disposition
  • Loading a partial DB cache
  • Migrating from DB cache ver.1
  1. ProudNet
  2. Using DB in ProudNet
  3. DB Cache System ver.2
  4. DB Cache usage and application

Utilization of DB Cache

PreviousDB Cache usage and applicationNextADO API

Last updated 1 year ago

Mixing ADO with the ProudNet DB cache system

The DB cache system and ADO Wrapper API can be used interchangeably. However, when users directly handle tables that are exclusively accessed by the , the following must be taken care of.

Reading tables

The data cached in Proud.CDbCacheServer2 may not have been flushed to the DBMS yet, so the data information you get may be older than the actual state. Writing tables Proud.CDbCacheServer2 writes to these tables intermittently, so if you write something to them, it might overwrite the data that Proud.CDbCacheServer2 writes to them. Therefore, it is not recommended to write to these tables.

Reference

Adjusting DB cache disposition

Shortening the interval between writing cached DB information to the DBMS reduces the risk of losing unsaved data due to an abnormal shutdown of the DB cache server at the expense of DBMS performance.

The related method is Proud.CDbCacheServer2.SetDbmsWriteIntervalMs.

When the data is used and unloaded by the DB cache client, the gamer information remains in the DB cache server's memory, and after a period of time, it is also destroyed in the DB cache server's memory.

If you make this time period shorter, the memory used by the DB cache server will increase, but the load on the DBMS will be less because the DBMS will fetch data less often.

The related method is Proud.CDbCacheServer2.SetUnloadedDataHibernateDurationMs.

Loading a partial DB cache

It is possible that only one of a gamer's characters needs to be loaded. Partial loading is possible using the features of the ProudNet DB cache system.

Examples * RootTable is the Gamer, CharacterInfo table. * ChildTable is a Hero under Gamer, and an Item under CharacterInfo. * At least one user-defined field in Hero points to one field in CharacterInfo.

Below is the approximate code.

Proud::Guid outSessionGuid;
Proud::CDbCacheClient2* c = ...;
c->RequestExclusiveLoadData(L"Gamer",L"GamerID",gamername,outSessionGuid);
//This request receives the loadedGamerData.
 
...//Find the character the user picked in loadedGamerData.
 
c->RequestExclusiveLoadData(L"CharacterInfo",L"HeroIndex",findCharacter->heroIndex,outSessionGuid); 
//Load an info tree for the character the user selected.

Migrating from DB cache ver.1

Item
ver 1
ver 2
Handling method

Issuing credential

Yes

No

Must implement credential issuance yourself

Gamer authentication callback by DB cache

Yes

No

Requires a direct call instead of a gamer authentication callback

In DB cache ver 1,

  • It covers the Gamer, Hero, and WorldObject tables, and requires you to specify the OwnerUUID, RootUUID, and ParentUUID to move them.

  • It deals with CLoadedHeroData, CLoadedItemData, and CLoadedGamerData, which should be dealing with CLoadedData instead.

Using the , you can load Gamer and CharacterInfo based on the character the user selects.

🌐
DB Cache Server and Client
Direct DB access to data covered by the DB cache
methods for loading proprietary data and adding new data