8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-24 02:43:03 +01:00

Fix the pool usage

This commit is contained in:
asfernandes 2008-03-31 01:51:18 +00:00
parent e89f8ec4ae
commit d11b683899
3 changed files with 7 additions and 5 deletions

View File

@ -32,9 +32,10 @@
namespace Jrd { namespace Jrd {
PreparedStatement::PreparedStatement(thread_db* tdbb, Firebird::MemoryPool& pool, PreparedStatement::PreparedStatement(thread_db* tdbb, Firebird::MemoryPool& aPool,
Attachment* attachment, jrd_tra* transaction, const Firebird::string& text) Attachment* attachment, jrd_tra* transaction, const Firebird::string& text)
: values(pool), : pool(aPool),
values(pool),
blr(pool), blr(pool),
message(pool), message(pool),
resultSet(NULL) resultSet(NULL)
@ -147,7 +148,7 @@ void PreparedStatement::execute(thread_db* tdbb, jrd_tra* transaction)
ResultSet* PreparedStatement::executeQuery(thread_db* tdbb, jrd_tra* transaction) ResultSet* PreparedStatement::executeQuery(thread_db* tdbb, jrd_tra* transaction)
{ {
fb_assert(resultSet == NULL && request->req_receive); fb_assert(resultSet == NULL && request->req_receive);
return new ResultSet(tdbb, this, transaction); return FB_NEW(pool) ResultSet(tdbb, this, transaction);
} }

View File

@ -42,7 +42,7 @@ class PreparedStatement
friend class ResultSet; friend class ResultSet;
public: public:
PreparedStatement(thread_db* tdbb, Firebird::MemoryPool& pool, Attachment* attachment, PreparedStatement(thread_db* tdbb, Firebird::MemoryPool& aPool, Attachment* attachment,
jrd_tra* transaction, const Firebird::string& text); jrd_tra* transaction, const Firebird::string& text);
~PreparedStatement(); ~PreparedStatement();
@ -61,6 +61,7 @@ private:
void generateBlr(const dsc* desc); void generateBlr(const dsc* desc);
private: private:
Firebird::MemoryPool& pool;
dsql_req* request; dsql_req* request;
Firebird::Array<dsc> values; Firebird::Array<dsc> values;
Firebird::UCharBuffer blr; Firebird::UCharBuffer blr;

View File

@ -4883,7 +4883,7 @@ Attachment::~Attachment()
PreparedStatement* Attachment::prepareStatement(thread_db* tdbb, Firebird::MemoryPool& pool, PreparedStatement* Attachment::prepareStatement(thread_db* tdbb, Firebird::MemoryPool& pool,
jrd_tra* transaction, const Firebird::string& text) jrd_tra* transaction, const Firebird::string& text)
{ {
return new PreparedStatement(tdbb, pool, this, transaction, text); return FB_NEW(pool) PreparedStatement(tdbb, pool, this, transaction, text);
} }