ExtDS.h (Firebird-3.0.2.32703-0.tar.bz2) | : | ExtDS.h (Firebird-3.0.4.33054-0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 49 | skipping to change at line 49 | |||
namespace EDS { | namespace EDS { | |||
class Manager; | class Manager; | |||
class Provider; | class Provider; | |||
class Connection; | class Connection; | |||
class Transaction; | class Transaction; | |||
class Statement; | class Statement; | |||
class Blob; | class Blob; | |||
enum TraModes {traReadCommited, traReadCommitedRecVersions, traConcurrency, traC onsistency}; | enum TraModes {traReadCommited, traReadCommitedRecVersions, traConcurrency, traC onsistency}; | |||
enum TraScope {traAutonomous = 1, traCommon, traTwoPhase}; | enum TraScope {traNotSet = 0, traAutonomous = 1, traCommon, traTwoPhase}; | |||
// Known built-in provider's names | // Known built-in provider's names | |||
extern const char* FIREBIRD_PROVIDER_NAME; | extern const char* FIREBIRD_PROVIDER_NAME; | |||
extern const char* INTERNAL_PROVIDER_NAME; | extern const char* INTERNAL_PROVIDER_NAME; | |||
// Manage providers | // Manage providers | |||
class Manager : public Firebird::PermanentStorage | class Manager : public Firebird::PermanentStorage | |||
{ | { | |||
public: | public: | |||
explicit Manager(Firebird::MemoryPool& pool); | explicit Manager(Firebird::MemoryPool& pool); | |||
skipping to change at line 88 | skipping to change at line 88 | |||
// manages connections\connection pool | // manages connections\connection pool | |||
class Provider : public Firebird::GlobalStorage | class Provider : public Firebird::GlobalStorage | |||
{ | { | |||
friend class Manager; | friend class Manager; | |||
friend class EngineCallbackGuard; | friend class EngineCallbackGuard; | |||
public: | public: | |||
explicit Provider(const char* prvName); | explicit Provider(const char* prvName); | |||
virtual ~Provider(); | ||||
// return existing or create new Connection | // return existing or create new Connection | |||
virtual Connection* getConnection(Jrd::thread_db* tdbb, const Firebird::P athName& dbName, | virtual Connection* getConnection(Jrd::thread_db* tdbb, const Firebird::P athName& dbName, | |||
const Firebird::string& user, const Firebird::string& pwd, const Firebird::string& role, | const Firebird::string& user, const Firebird::string& pwd, const Firebird::string& role, | |||
TraScope tra_scope); | TraScope tra_scope); | |||
// Connection gets unused, release it into pool or delete it completely | // Connection gets unused, release it into pool or delete it completely | |||
virtual void releaseConnection(Jrd::thread_db* tdbb, Connection& conn, bo ol inPool = true); | virtual void releaseConnection(Jrd::thread_db* tdbb, Connection& conn, bo ol inPool = true); | |||
// Notify provider when some jrd attachment is about to be released | // Notify provider when some jrd attachment is about to be released | |||
skipping to change at line 120 | skipping to change at line 119 | |||
// Interprete status and put error description into passed string | // Interprete status and put error description into passed string | |||
virtual void getRemoteError(const Jrd::FbStatusVector* status, Firebird:: string& err) const = 0; | virtual void getRemoteError(const Jrd::FbStatusVector* status, Firebird:: string& err) const = 0; | |||
static const Firebird::string* generate(const Provider* item) | static const Firebird::string* generate(const Provider* item) | |||
{ | { | |||
return &item->m_name; | return &item->m_name; | |||
} | } | |||
protected: | protected: | |||
virtual ~Provider(); | ||||
void clearConnections(Jrd::thread_db* tdbb); | void clearConnections(Jrd::thread_db* tdbb); | |||
virtual Connection* doCreateConnection() = 0; | virtual Connection* doCreateConnection() = 0; | |||
// Protection against simultaneous attach database calls. Not sure we sti ll | // Protection against simultaneous attach database calls. Not sure we sti ll | |||
// need it, but i believe it will not harm | // need it, but i believe it will not harm | |||
Firebird::Mutex m_mutex; | Firebird::Mutex m_mutex; | |||
Firebird::string m_name; | Firebird::string m_name; | |||
Provider* m_next; | Provider* m_next; | |||
skipping to change at line 159 | skipping to change at line 159 | |||
public: | public: | |||
static void deleteConnection(Jrd::thread_db* tdbb, Connection* conn); | static void deleteConnection(Jrd::thread_db* tdbb, Connection* conn); | |||
Provider* getProvider() { return &m_provider; } | Provider* getProvider() { return &m_provider; } | |||
virtual void attach(Jrd::thread_db* tdbb, const Firebird::PathName& dbNam e, | virtual void attach(Jrd::thread_db* tdbb, const Firebird::PathName& dbNam e, | |||
const Firebird::string& user, const Firebird::string& pwd, | const Firebird::string& user, const Firebird::string& pwd, | |||
const Firebird::string& role) = 0; | const Firebird::string& role) = 0; | |||
virtual void detach(Jrd::thread_db* tdbb); | virtual void detach(Jrd::thread_db* tdbb); | |||
virtual bool cancelExecution() = 0; | virtual bool cancelExecution(bool forced) = 0; | |||
int getSqlDialect() const { return m_sqlDialect; } | int getSqlDialect() const { return m_sqlDialect; } | |||
// Is this connections can be used by current needs ? Not every DBMS | // Is this connections can be used by current needs ? Not every DBMS | |||
// allows to use same connection in more than one transaction and\or | // allows to use same connection in more than one transaction and\or | |||
// to have more than on active statement at time. See also provider | // to have more than on active statement at time. See also provider | |||
// flags above. | // flags above. | |||
virtual bool isAvailable(Jrd::thread_db* tdbb, TraScope traScope) const = 0; | virtual bool isAvailable(Jrd::thread_db* tdbb, TraScope traScope) const = 0; | |||
virtual bool isConnected() const = 0; | virtual bool isConnected() const = 0; | |||
skipping to change at line 200 | skipping to change at line 200 | |||
void raise(const Jrd::FbStatusVector* status, Jrd::thread_db* tdbb, const char* sWhere); | void raise(const Jrd::FbStatusVector* status, Jrd::thread_db* tdbb, const char* sWhere); | |||
// will we wrap external errors into our ones (isc_eds_xxx) or pass them as is | // will we wrap external errors into our ones (isc_eds_xxx) or pass them as is | |||
bool getWrapErrors(const ISC_STATUS* status); | bool getWrapErrors(const ISC_STATUS* status); | |||
void setWrapErrors(bool val) { m_wrapErrors = val; } | void setWrapErrors(bool val) { m_wrapErrors = val; } | |||
// Transactions management within connection scope : put newly created | // Transactions management within connection scope : put newly created | |||
// transaction into m_transactions array and delete not needed transactio n | // transaction into m_transactions array and delete not needed transactio n | |||
// immediately (as we didn't pool transactions) | // immediately (as we didn't pool transactions) | |||
Transaction* createTransaction(); | Transaction* createTransaction(); | |||
void deleteTransaction(Transaction* tran); | void deleteTransaction(Jrd::thread_db* tdbb, Transaction* tran); | |||
// Statements management within connection scope : put newly created | // Statements management within connection scope : put newly created | |||
// statement into m_statements array, but don't delete freed statement | // statement into m_statements array, but don't delete freed statement | |||
// immediately (as we did pooled statements). Instead keep it in | // immediately (as we did pooled statements). Instead keep it in | |||
// m_freeStatements list for reuse later | // m_freeStatements list for reuse later | |||
Statement* createStatement(const Firebird::string& sql); | Statement* createStatement(const Firebird::string& sql); | |||
void releaseStatement(Jrd::thread_db* tdbb, Statement* stmt); | void releaseStatement(Jrd::thread_db* tdbb, Statement* stmt); | |||
virtual Blob* createBlob() = 0; | virtual Blob* createBlob() = 0; | |||
skipping to change at line 321 | skipping to change at line 321 | |||
Transaction* getTransaction() { return m_transaction; } | Transaction* getTransaction() { return m_transaction; } | |||
void prepare(Jrd::thread_db* tdbb, Transaction* tran, const Firebird::str ing& sql, bool named); | void prepare(Jrd::thread_db* tdbb, Transaction* tran, const Firebird::str ing& sql, bool named); | |||
void execute(Jrd::thread_db* tdbb, Transaction* tran, | void execute(Jrd::thread_db* tdbb, Transaction* tran, | |||
const Firebird::MetaName* const* in_names, const Jrd::ValueListNo de* in_params, | const Firebird::MetaName* const* in_names, const Jrd::ValueListNo de* in_params, | |||
const Jrd::ValueListNode* out_params); | const Jrd::ValueListNode* out_params); | |||
void open(Jrd::thread_db* tdbb, Transaction* tran, | void open(Jrd::thread_db* tdbb, Transaction* tran, | |||
const Firebird::MetaName* const* in_names, const Jrd::ValueListNo de* in_params, bool singleton); | const Firebird::MetaName* const* in_names, const Jrd::ValueListNo de* in_params, bool singleton); | |||
bool fetch(Jrd::thread_db* tdbb, const Jrd::ValueListNode* out_params); | bool fetch(Jrd::thread_db* tdbb, const Jrd::ValueListNode* out_params); | |||
void close(Jrd::thread_db* tdbb); | void close(Jrd::thread_db* tdbb, bool invalidTran = false); | |||
void deallocate(Jrd::thread_db* tdbb); | void deallocate(Jrd::thread_db* tdbb); | |||
const Firebird::string& getSql() const { return m_sql; } | const Firebird::string& getSql() const { return m_sql; } | |||
void setCallerPrivileges(bool use) { m_callerPrivileges = use; } | void setCallerPrivileges(bool use) { m_callerPrivileges = use; } | |||
bool isActive() const { return m_active; } | bool isActive() const { return m_active; } | |||
bool isAllocated() const { return m_allocated; } | bool isAllocated() const { return m_allocated; } | |||
skipping to change at line 462 | skipping to change at line 462 | |||
{ | { | |||
init(tdbb, *stmt.getConnection(), from); | init(tdbb, *stmt.getConnection(), from); | |||
} | } | |||
~EngineCallbackGuard(); | ~EngineCallbackGuard(); | |||
private: | private: | |||
void init(Jrd::thread_db* tdbb, Connection& conn, const char* from); | void init(Jrd::thread_db* tdbb, Connection& conn, const char* from); | |||
Jrd::thread_db* m_tdbb; | Jrd::thread_db* m_tdbb; | |||
Firebird::RefPtr<Jrd::StableAttachmentPart> m_stable; | ||||
Firebird::Mutex* m_mutex; | Firebird::Mutex* m_mutex; | |||
Connection* m_saveConnection; | Connection* m_saveConnection; | |||
}; | }; | |||
} // namespace EDS | } // namespace EDS | |||
#endif // EXTDS_H | #endif // EXTDS_H | |||
End of changes. 7 change blocks. | ||||
5 lines changed or deleted | 6 lines changed or added |