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
  • How to load proprietary data and add new data
  • Making unilateral data changes
  • Use of request-responsive and blocked methods that are reflected in DBMS first
  • Request-responsive SessionGuid
  • Non-proprietary data access methods
  • Precautions for using DB cache
  • Usage
  1. ProudNet
  2. Using DB in ProudNet
  3. DB Cache System ver.2

DB Cache usage and application

PreviousDB Cache Server and ClientNextUtilization of DB Cache

Last updated 1 year ago

How to load proprietary data and add new data

The method is Proud.CDbCacheClient2.RequestExclusiveLoadData. To search for data to load, you must enter search conditions in the arguments fieldName and cmpValue.

This is a usage example.

Proud::Guid outSessetionGuid;
Proud::CDbCacheClient2* c = ...;
c->RequestExclusiveLoadData(L"Gamer",L"GamerID",gamername,outSessetionGuid);

The Proud.CDbCacheClient2.RequestExclusiveLoadNewData method is similarly a proprietary load function, but it is used when you add data to RootTable and write it right away.

This is a usage example.

CPropNodePtr newNode = CPropNodePtr(new CPropNode(L"Gamer"));
 
newNode->Fields[L"GamerID"] = "Ulelio";
 
Proud::Guid outSessetionGuid;
Proud::CDbCacheClient2* c = ...;
c->RequestExclusiveLoadNewData(L"Gamer", newNode, outSessetionGuid);

Making unilateral data changes

  • Proud.CDbCacheClient2.UnilateralAddData

  • Proud.CDbCacheClient2.UnilateralUpdateData

  • Proud.CDbCacheClient2.UnilateralRemoveData

These methods return immediately upon call because they reflect the change in DB cache memory and later do the actual writing to the DBMS asynchronously. They also have no response method callbacks.

Use of request-responsive and blocked methods that are reflected in DBMS first

Calling methods
Result callback

Proud.CDbCacheClient2.RequestAddData

Proud.IDbCacheClientDelegate2.OnAddDataFailed

Proud.IDbCacheClientDelegate2.OnAddDataSuccess

Proud.CDbCacheClient2.RequestUpdateData

Proud.IDbCacheClientDelegate2.OnUpdateDataFailed

Proud.IDbCacheClientDelegate2.OnUpdateDataSuccess

Proud.CDbCacheClient2.RequestRemoveData

Proud.IDbCacheClientDelegate2.OnRemoveDataFailed

Proud.IDbCacheClientDelegate2.OnRemoveDataSuccess

If you want a blocked call rather than a request-responsive one, use these methods.

  • Proud.CDbCacheClient2.BlockedAddData

  • Proud.CDbCacheClient2.BlockedUpdateData

  • Proud.CDbCacheClient2.BlockedRemoveData

Request-responsive SessionGuid

The proprietary clients will have one session each, and the DB Cache client will use a Guid value to distinguish between them. When requesting, the SessionGuid value is issued as an Output parameter, and the value issued as CCallbackArgs::m_sessionGuid of the response Event is received. You can check the requested session by saving and comparing outSessionGuid.

Request

CDbCacheClient2::RequestExclusiveLoadNewData(String rootTableName, CPropNodePtr addData, Guid &outSessionGuid);

Response

IDbCacheClientDelegate2::OnExclusiveLoadDataFailed(CCallbackArgs args)

The outSessionGuid of the request is the same as the args.m_sessionGuid of the response.

Non-proprietary data access methods

You must set Proud.CDbCacheServer2StartParameter.m_allowNonExclusiveAccess to allow non-proprietary access.

Calling methods
Result callback

Proud.CDbCacheClient2.RequestNonExclusiveSnapshotData

Proud.IDbCacheClientDelegate2.OnNonExclusiveSnapshotDataFailed

Proud.IDbCacheClientDelegate2.OnNonExclusiveSnapshotDataSuccess

Proud.CDbCacheClient2.RequestNonExclusiveAddData

Proud.IDbCacheClientDelegate2.OnNonExclusiveAddDataAck

Proud.CDbCacheClient2.RequestNonExclusiveRemoveData

Proud.IDbCacheClientDelegate2.OnNonExclusiveRemoveDataAck

Proud.CDbCacheClient2.RequestNonExclusiveSetValueIf

Proud.IDbCacheClientDelegate2.OnNonExclusiveSetValueIfFailed

Proud.IDbCacheClientDelegate2.OnNonExclusiveSetValueIfSuccess

Proud.CDbCacheClient2.RequestNonExclusiveModifyValue

Proud.IDbCacheClientDelegate2.OnNonExclusiveModifyValueFailed

Proud.IDbCacheClientDelegate2.OnNonExclusiveModifyValueSuccess

When a non-proprietary data change is successful, the change is reported to the DB cache client that was loading the data exclusively. The following methods are called for reporting.

  • Proud.IDbCacheClientDelegate2.OnSomeoneAddData

  • Proud.IDbCacheClientDelegate2.OnSomeoneRemoveData

  • Proud.IDbCacheClientDelegate2.OnSomeoneModifyValue

  • Proud.IDbCacheClientDelegate2.OnSomeoneSetValue

To make it easier to view, each request and response relationship is grouped together as follows.

Proud.CDbCacheClient2.RequestNonExclusiveSnapshotData : Get a snapshot

// Response:
IDbCacheClientDelegate2::OnNonExclusiveSnapshotDataSuccess (CCallbackArgs args)
IDbCacheClientDelegate2::OnNonExclusiveSnapshotDataFailed (CCallbackArgs args)

Proud.CDbCacheClient2.RequestNonExclusiveAddData : Add data

// Response:
IDbCacheClientDelegate2::OnNonExclusiveAddDataAck (CCallbackArgs args)
// Callback Event of proprietary DB Cache Client:
IDbCacheClientDelegate2::OnSomeoneAddData(CCallbackArgs& args)

Proud.CDbCacheClient2.RequestNonExclusiveRemoveData : Remove data

// Response:
IDbCacheClientDelegate2::OnNonExclusiveRemoveDataAck (CCallbackArgs args)
// Callback Event of proprietary DB Cache Client:
IDbCacheClientDelegate2::OnSomeoneRemoveData (CCallbackArgs& args)

Proud.CDbCacheClient2.RequestNonExclusiveModifyValue : Perform specific operations on data.(+, -, *, /)

// Response:
IDbCacheClientDelegate2::OnNonExclusiveModifyValueSuccess (CCallbackArgs args)
IDbCacheClientDelegate2::OnNonExclusiveModifyValueFailed (CCallbackArgs args)
// Callback Event of proprietary DB Cache Client:
IDbCacheClientDelegate2::OnSomeoneModifyValue (CCallbackArgs& args)

Proud.CDbCacheClient2.RequestNonExclusiveSetValueIf : Request to compare and store two values.

// Response:
IDbCacheClientDelegate2::OnNonExclusiveSetValueIfSuccess (CCallbackArgs args)
IDbCacheClientDelegate2::OnNonExclusiveSetValueIfFailed (CCallbackArgs args)
 
// Callback Event of proprietary DB Cache Client:
IDbCacheClientDelegate2::OnSomeoneSetValue (CCallbackArgs& args)

Precautions for using DB cache

This is a precaution when mixing unilateral type and request-response type (proprietary data request-response type & Block type & non-proprietary data access).

  • Using a unilateral method while a request-response method is in use can cause Proud.IDbCacheClientDelegate2.OnAccessError to be called.

  • If you use a unilateral method without getting a response for the data you changed, you may end up with the wrong data.


Usage

Using request-responsive methods and blocked methods, which are reflected in the DBMS first, are methods for . Returns immediately upon call, and changes are only reflected in the DB cache's memory after they have been written to the actual DBMS.

🌐
Utilization of DB Cache
proprietary load
request-responsive data changes