/* ==================================================================== * ÆÄ ÀÏ : sqlPool.h * ¸ñ Àû : * ÀÛ ¼º ÀÚ : °ûöÁß * ÀÛ ¼º ÀÏ : 07/01/10 * ÁÖÀÇ»çÇ× : * =================================================================== */ #ifndef __SQL_POOL_H__ #define __SQL_POOL_H__ //#ifndef WINVER //#define WINVER 0x0500 //#endif // //#ifndef _WIN32_WINNT //#define _WIN32_WINNT 0x0500 //#endif #pragma once #include "odbcsql.h" #include "threadpool.h" #include "criticalsectionlock.h" #ifndef PER_SQL_CONNECTION #define PER_SQL_CONNECTION struct PerSQLConnection { cSQLConnection* sqlConnection; // SQL Connection cSQLStatement* sqlStatement; // SQL Statement struct PerSQLConnection* next; // Dual Linked List ÂüÁ¶ Æ÷ÀÎÅÍ struct PerSQLConnection* prev; // Dual Linked List ÂüÁ¶ Æ÷ÀÎÅÍ }; #endif // PER_SQL_CONNECTION class cSQLPool : public cThreadPool { protected: // ȯ°æº¯¼ö. CRITICAL_SECTION mCs; cSQLEnvironment* mSqlEnv; PerSQLConnection* mPagedPoolUsage; // ÆäÀÌÁö µÈ Ç® PerSQLConnection* mNonPagedPoolUsage; // ÆäÀÌÁö ¾ÈµÈ Ç® SIZE_T mQuotaPagedPoolUsage; // ÇöÀç ÆäÀÌÁö µÈ Ç® - »ç¿ë·® SIZE_T mQuotaNonPagedPoolUsage; // ÇöÀç ÆäÀÌÁö ¾ÈµÈ Ç® - »ç¿ë·® SIZE_T mWorkingSetSize; // ÇöÀç ÀÛ¾÷ ¼³Á¤Å©±â. SIZE_T mPeakWorkingSetSize; // ÃÖ´ë ÀÛ¾÷ ¼³Á¤Å©±â. char mDsn[MAX_PATH]; // DataSource char mUid[MAX_PATH]; // UserID char mPwd[MAX_PATH]; // Password protected: // Page Pool °ü¸® ¸Þ¼Òµå. virtual PerSQLConnection* AllocSQLConnection ( void ); virtual void FreeSQLConnection ( PerSQLConnection** perSQLConnection ); void AttachPool ( PerSQLConnection** pool, PerSQLConnection* perSQLConnection ); void DetachPool ( PerSQLConnection** pool, PerSQLConnection* perSQLConnection ); PerSQLConnection* GetPool ( void ); void ReleasePool ( PerSQLConnection* perSQLConnection ); public: // Ŭ·¡½º »ý¼º ¹× °ø¿ë ¸Þ¼Òµå. cSQLPool(void); virtual void GetProcessMemoryInfo ( SIZE_T& quotaPagedPoolUsage, SIZE_T& quotaNonPagedPoolUsage, SIZE_T& workingSetSize ); virtual bool Initialize ( char* dsn, char* uid, char* pwd, int numWorkerThreads=2 ); virtual void Shutdown ( void ); virtual DWORD WorkerThread ( void ); public: // Ŭ·¡½º ÆÄ±« ¸Þ¼Òµå. virtual ~cSQLPool(void); }; #endif // __SQL_POOL_H__