From 11712f82039cb0318140593f433019297ae07407 Mon Sep 17 00:00:00 2001 From: AlexPeshkoff Date: Mon, 16 Aug 2021 20:57:55 +0300 Subject: [PATCH] Fixed #6886: Differerent interfaces behaviour depending upon source of interface (cherry picked from commit de15522f32c2a7a5ab891977ae14a679e3decd89) --- src/common/classes/RefCounted.h | 7 + src/include/firebird/FirebirdInterface.idl | 52 +- src/include/firebird/IdlFbInterfaces.h | 596 ++++++++++++++++++--- src/include/gen/Firebird.pas | 504 +++++++++++++---- src/jrd/EngineInterface.h | 14 + src/jrd/jrd.cpp | 134 ++++- src/remote/client/interface.cpp | 164 +++++- src/yvalve/DistributedTransaction.cpp | 51 +- src/yvalve/YObjects.h | 20 +- src/yvalve/why.cpp | 211 +++++--- 10 files changed, 1429 insertions(+), 324 deletions(-) diff --git a/src/common/classes/RefCounted.h b/src/common/classes/RefCounted.h index f654afd8cc..180e1ffba6 100644 --- a/src/common/classes/RefCounted.h +++ b/src/common/classes/RefCounted.h @@ -137,6 +137,13 @@ namespace Firebird r.ptr = NULL; } + T* clear() // nullify pointer w/o calling release + { + T* rc = ptr; + ptr = NULL; + return rc; + } + T* operator=(T* p) { return assign(p); diff --git a/src/include/firebird/FirebirdInterface.idl b/src/include/firebird/FirebirdInterface.idl index c1f17a346a..09ee36aaf3 100644 --- a/src/include/firebird/FirebirdInterface.idl +++ b/src/include/firebird/FirebirdInterface.idl @@ -347,9 +347,13 @@ interface Blob : ReferenceCounted void putSegment(Status status, uint length, const void* buffer); + void cancel_1(Status status); + void close_1(Status status); + int seek(Status status, int mode, int offset); // returns position + +version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 void cancel(Status status); void close(Status status); - int seek(Status status, int mode, int offset); // returns position } interface Transaction : ReferenceCounted @@ -359,14 +363,19 @@ interface Transaction : ReferenceCounted uint bufferLength, uchar* buffer); void prepare(Status status, uint msgLength, const uchar* message); - void commit(Status status); + void commit_1(Status status); void commitRetaining(Status status); - void rollback(Status status); + void rollback_1(Status status); void rollbackRetaining(Status status); - void disconnect(Status status); + void disconnect_1(Status status); Transaction join(Status status, Transaction transaction); Transaction validate(Status status, Attachment attachment); Transaction enterDtc(Status status); + +version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + void commit(Status status); + void rollback(Status status); + void disconnect(Status status); } interface MessageMetadata : ReferenceCounted @@ -426,12 +435,15 @@ interface ResultSet : ReferenceCounted boolean isEof(Status status); boolean isBof(Status status); MessageMetadata getMetadata(Status status); - void close(Status status); + void close_1(Status status); // This item is for ISC API emulation only // It may be gone in future versions // Please do not use it! void setDelayedOutputFormat(Status status, MessageMetadata format); + +version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + void close(Status status); } interface Statement : ReferenceCounted @@ -472,7 +484,7 @@ interface Statement : ReferenceCounted ResultSet openCursor(Status status, Transaction transaction, MessageMetadata inMetadata, void* inBuffer, MessageMetadata outMetadata, uint flags); void setCursorName(Status status, const string name); - void free(Status status); + void free_1(Status status); uint getFlags(Status status); version: // 3.0 => 4.0 @@ -487,6 +499,9 @@ version: // 3.0 => 4.0 Pipe createPipe(Status status, Transaction transaction, MessageMetadata inMetadata, void* inBuffer, MessageMetadata outMetadata, uint parLength, const uchar* par); */ + +version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + void free(Status status); } interface Batch : ReferenceCounted @@ -516,6 +531,9 @@ interface Batch : ReferenceCounted uint getBlobAlignment(Status status); MessageMetadata getMetadata(Status status); void setDefaultBpb(Status status, uint parLength, const uchar* par); + void close_1(Status status); + +version: // 4.0.0 => 4.0.1 void close(Status status); } @@ -554,6 +572,9 @@ interface Replicator : ReferenceCounted void process(Status status, ReplicationBatch batch); */ void process(Status status, uint length, const uchar* data); + void close_1(Status status); + +version: // 4.0.0 => 4.0.1 void close(Status status); } @@ -570,11 +591,17 @@ interface Request : ReferenceCounted void startAndSend(Status status, Transaction tra, int level, uint msgType, uint length, const void* message); void unwind(Status status, int level); + void free_1(Status status); + +version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 void free(Status status); } interface Events : ReferenceCounted { + void cancel_1(Status status); + +version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 void cancel(Status status); } @@ -620,8 +647,8 @@ interface Attachment : ReferenceCounted uint length, const uchar* events); void cancelOperation(Status status, int option); void ping(Status status); - void detach(Status status); - void dropDatabase(Status status); + void detach_1(Status status); + void dropDatabase_1(Status status); version: // 3.0 => 4.0 // Idle attachment timeout, seconds @@ -643,17 +670,24 @@ version: // 3.0 => 4.0 */ Replicator createReplicator(Status status); + +version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + void detach(Status status); + void dropDatabase(Status status); } interface Service : ReferenceCounted { - void detach(Status status); + void detach_1(Status status); void query(Status status, uint sendLength, const uchar* sendItems, uint receiveLength, const uchar* receiveItems, uint bufferLength, uchar* buffer); void start(Status status, uint spbLength, const uchar* spb); + +version: // 3.0.7 => 3.0.8, 4.0.0 => 4.0.1 + void detach(Status status); } interface Provider : PluginBase diff --git a/src/include/firebird/IdlFbInterfaces.h b/src/include/firebird/IdlFbInterfaces.h index 37de20117f..ba6d219d98 100644 --- a/src/include/firebird/IdlFbInterfaces.h +++ b/src/include/firebird/IdlFbInterfaces.h @@ -1044,9 +1044,11 @@ namespace Firebird void (CLOOP_CARG *getInfo)(IBlob* self, IStatus* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) throw(); int (CLOOP_CARG *getSegment)(IBlob* self, IStatus* status, unsigned bufferLength, void* buffer, unsigned* segmentLength) throw(); void (CLOOP_CARG *putSegment)(IBlob* self, IStatus* status, unsigned length, const void* buffer) throw(); + void (CLOOP_CARG *cancel_1)(IBlob* self, IStatus* status) throw(); + void (CLOOP_CARG *close_1)(IBlob* self, IStatus* status) throw(); + int (CLOOP_CARG *seek)(IBlob* self, IStatus* status, int mode, int offset) throw(); void (CLOOP_CARG *cancel)(IBlob* self, IStatus* status) throw(); void (CLOOP_CARG *close)(IBlob* self, IStatus* status) throw(); - int (CLOOP_CARG *seek)(IBlob* self, IStatus* status, int mode, int offset) throw(); }; protected: @@ -1060,7 +1062,7 @@ namespace Firebird } public: - static const unsigned VERSION = 3; + static const unsigned VERSION = 4; template void getInfo(StatusType* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) { @@ -1084,17 +1086,17 @@ namespace Firebird StatusType::checkException(status); } - template void cancel(StatusType* status) + template void cancel_1(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->cancel(this, status); + static_cast(this->cloopVTable)->cancel_1(this, status); StatusType::checkException(status); } - template void close(StatusType* status) + template void close_1(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->close(this, status); + static_cast(this->cloopVTable)->close_1(this, status); StatusType::checkException(status); } @@ -1105,6 +1107,32 @@ namespace Firebird StatusType::checkException(status); return ret; } + + template void cancel(StatusType* status) + { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "IBlob", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } + StatusType::clearException(status); + static_cast(this->cloopVTable)->cancel(this, status); + StatusType::checkException(status); + } + + template void close(StatusType* status) + { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "IBlob", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } + StatusType::clearException(status); + static_cast(this->cloopVTable)->close(this, status); + StatusType::checkException(status); + } }; class ITransaction : public IReferenceCounted @@ -1114,14 +1142,17 @@ namespace Firebird { void (CLOOP_CARG *getInfo)(ITransaction* self, IStatus* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) throw(); void (CLOOP_CARG *prepare)(ITransaction* self, IStatus* status, unsigned msgLength, const unsigned char* message) throw(); - void (CLOOP_CARG *commit)(ITransaction* self, IStatus* status) throw(); + void (CLOOP_CARG *commit_1)(ITransaction* self, IStatus* status) throw(); void (CLOOP_CARG *commitRetaining)(ITransaction* self, IStatus* status) throw(); - void (CLOOP_CARG *rollback)(ITransaction* self, IStatus* status) throw(); + void (CLOOP_CARG *rollback_1)(ITransaction* self, IStatus* status) throw(); void (CLOOP_CARG *rollbackRetaining)(ITransaction* self, IStatus* status) throw(); - void (CLOOP_CARG *disconnect)(ITransaction* self, IStatus* status) throw(); + void (CLOOP_CARG *disconnect_1)(ITransaction* self, IStatus* status) throw(); ITransaction* (CLOOP_CARG *join)(ITransaction* self, IStatus* status, ITransaction* transaction) throw(); ITransaction* (CLOOP_CARG *validate)(ITransaction* self, IStatus* status, IAttachment* attachment) throw(); ITransaction* (CLOOP_CARG *enterDtc)(ITransaction* self, IStatus* status) throw(); + void (CLOOP_CARG *commit)(ITransaction* self, IStatus* status) throw(); + void (CLOOP_CARG *rollback)(ITransaction* self, IStatus* status) throw(); + void (CLOOP_CARG *disconnect)(ITransaction* self, IStatus* status) throw(); }; protected: @@ -1135,7 +1166,7 @@ namespace Firebird } public: - static const unsigned VERSION = 3; + static const unsigned VERSION = 4; template void getInfo(StatusType* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) { @@ -1151,10 +1182,10 @@ namespace Firebird StatusType::checkException(status); } - template void commit(StatusType* status) + template void commit_1(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->commit(this, status); + static_cast(this->cloopVTable)->commit_1(this, status); StatusType::checkException(status); } @@ -1165,10 +1196,10 @@ namespace Firebird StatusType::checkException(status); } - template void rollback(StatusType* status) + template void rollback_1(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->rollback(this, status); + static_cast(this->cloopVTable)->rollback_1(this, status); StatusType::checkException(status); } @@ -1179,10 +1210,10 @@ namespace Firebird StatusType::checkException(status); } - template void disconnect(StatusType* status) + template void disconnect_1(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->disconnect(this, status); + static_cast(this->cloopVTable)->disconnect_1(this, status); StatusType::checkException(status); } @@ -1209,6 +1240,45 @@ namespace Firebird StatusType::checkException(status); return ret; } + + template void commit(StatusType* status) + { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "ITransaction", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } + StatusType::clearException(status); + static_cast(this->cloopVTable)->commit(this, status); + StatusType::checkException(status); + } + + template void rollback(StatusType* status) + { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "ITransaction", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } + StatusType::clearException(status); + static_cast(this->cloopVTable)->rollback(this, status); + StatusType::checkException(status); + } + + template void disconnect(StatusType* status) + { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "ITransaction", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } + StatusType::clearException(status); + static_cast(this->cloopVTable)->disconnect(this, status); + StatusType::checkException(status); + } }; class IMessageMetadata : public IReferenceCounted @@ -1570,8 +1640,9 @@ namespace Firebird FB_BOOLEAN (CLOOP_CARG *isEof)(IResultSet* self, IStatus* status) throw(); FB_BOOLEAN (CLOOP_CARG *isBof)(IResultSet* self, IStatus* status) throw(); IMessageMetadata* (CLOOP_CARG *getMetadata)(IResultSet* self, IStatus* status) throw(); - void (CLOOP_CARG *close)(IResultSet* self, IStatus* status) throw(); + void (CLOOP_CARG *close_1)(IResultSet* self, IStatus* status) throw(); void (CLOOP_CARG *setDelayedOutputFormat)(IResultSet* self, IStatus* status, IMessageMetadata* format) throw(); + void (CLOOP_CARG *close)(IResultSet* self, IStatus* status) throw(); }; protected: @@ -1585,7 +1656,7 @@ namespace Firebird } public: - static const unsigned VERSION = 3; + static const unsigned VERSION = 4; template int fetchNext(StatusType* status, void* message) { @@ -1659,10 +1730,10 @@ namespace Firebird return ret; } - template void close(StatusType* status) + template void close_1(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->close(this, status); + static_cast(this->cloopVTable)->close_1(this, status); StatusType::checkException(status); } @@ -1672,6 +1743,19 @@ namespace Firebird static_cast(this->cloopVTable)->setDelayedOutputFormat(this, status, format); StatusType::checkException(status); } + + template void close(StatusType* status) + { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "IResultSet", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } + StatusType::clearException(status); + static_cast(this->cloopVTable)->close(this, status); + StatusType::checkException(status); + } }; class IStatement : public IReferenceCounted @@ -1688,11 +1772,12 @@ namespace Firebird ITransaction* (CLOOP_CARG *execute)(IStatement* self, IStatus* status, ITransaction* transaction, IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outMetadata, void* outBuffer) throw(); IResultSet* (CLOOP_CARG *openCursor)(IStatement* self, IStatus* status, ITransaction* transaction, IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outMetadata, unsigned flags) throw(); void (CLOOP_CARG *setCursorName)(IStatement* self, IStatus* status, const char* name) throw(); - void (CLOOP_CARG *free)(IStatement* self, IStatus* status) throw(); + void (CLOOP_CARG *free_1)(IStatement* self, IStatus* status) throw(); unsigned (CLOOP_CARG *getFlags)(IStatement* self, IStatus* status) throw(); unsigned (CLOOP_CARG *getTimeout)(IStatement* self, IStatus* status) throw(); void (CLOOP_CARG *setTimeout)(IStatement* self, IStatus* status, unsigned timeOut) throw(); IBatch* (CLOOP_CARG *createBatch)(IStatement* self, IStatus* status, IMessageMetadata* inMetadata, unsigned parLength, const unsigned char* par) throw(); + void (CLOOP_CARG *free)(IStatement* self, IStatus* status) throw(); }; protected: @@ -1706,7 +1791,7 @@ namespace Firebird } public: - static const unsigned VERSION = 4; + static const unsigned VERSION = 5; static const unsigned PREPARE_PREFETCH_NONE = 0x0; static const unsigned PREPARE_PREFETCH_TYPE = 0x1; @@ -1792,10 +1877,10 @@ namespace Firebird StatusType::checkException(status); } - template void free(StatusType* status) + template void free_1(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->free(this, status); + static_cast(this->cloopVTable)->free_1(this, status); StatusType::checkException(status); } @@ -1847,6 +1932,19 @@ namespace Firebird StatusType::checkException(status); return ret; } + + template void free(StatusType* status) + { + if (cloopVTable->version < 5) + { + StatusType::setVersionError(status, "IStatement", cloopVTable->version, 5); + StatusType::checkException(status); + return; + } + StatusType::clearException(status); + static_cast(this->cloopVTable)->free(this, status); + StatusType::checkException(status); + } }; class IBatch : public IReferenceCounted @@ -1864,6 +1962,7 @@ namespace Firebird unsigned (CLOOP_CARG *getBlobAlignment)(IBatch* self, IStatus* status) throw(); IMessageMetadata* (CLOOP_CARG *getMetadata)(IBatch* self, IStatus* status) throw(); void (CLOOP_CARG *setDefaultBpb)(IBatch* self, IStatus* status, unsigned parLength, const unsigned char* par) throw(); + void (CLOOP_CARG *close_1)(IBatch* self, IStatus* status) throw(); void (CLOOP_CARG *close)(IBatch* self, IStatus* status) throw(); }; @@ -1878,7 +1977,7 @@ namespace Firebird } public: - static const unsigned VERSION = 3; + static const unsigned VERSION = 4; static const unsigned char VERSION1 = 1; static const unsigned char TAG_MULTIERROR = 1; @@ -1965,8 +2064,21 @@ namespace Firebird StatusType::checkException(status); } + template void close_1(StatusType* status) + { + StatusType::clearException(status); + static_cast(this->cloopVTable)->close_1(this, status); + StatusType::checkException(status); + } + template void close(StatusType* status) { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "IBatch", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } StatusType::clearException(status); static_cast(this->cloopVTable)->close(this, status); StatusType::checkException(status); @@ -2039,6 +2151,7 @@ namespace Firebird struct VTable : public IReferenceCounted::VTable { void (CLOOP_CARG *process)(IReplicator* self, IStatus* status, unsigned length, const unsigned char* data) throw(); + void (CLOOP_CARG *close_1)(IReplicator* self, IStatus* status) throw(); void (CLOOP_CARG *close)(IReplicator* self, IStatus* status) throw(); }; @@ -2053,7 +2166,7 @@ namespace Firebird } public: - static const unsigned VERSION = 3; + static const unsigned VERSION = 4; template void process(StatusType* status, unsigned length, const unsigned char* data) { @@ -2062,8 +2175,21 @@ namespace Firebird StatusType::checkException(status); } + template void close_1(StatusType* status) + { + StatusType::clearException(status); + static_cast(this->cloopVTable)->close_1(this, status); + StatusType::checkException(status); + } + template void close(StatusType* status) { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "IReplicator", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } StatusType::clearException(status); static_cast(this->cloopVTable)->close(this, status); StatusType::checkException(status); @@ -2081,6 +2207,7 @@ namespace Firebird void (CLOOP_CARG *start)(IRequest* self, IStatus* status, ITransaction* tra, int level) throw(); void (CLOOP_CARG *startAndSend)(IRequest* self, IStatus* status, ITransaction* tra, int level, unsigned msgType, unsigned length, const void* message) throw(); void (CLOOP_CARG *unwind)(IRequest* self, IStatus* status, int level) throw(); + void (CLOOP_CARG *free_1)(IRequest* self, IStatus* status) throw(); void (CLOOP_CARG *free)(IRequest* self, IStatus* status) throw(); }; @@ -2095,7 +2222,7 @@ namespace Firebird } public: - static const unsigned VERSION = 3; + static const unsigned VERSION = 4; template void receive(StatusType* status, int level, unsigned msgType, unsigned length, void* message) { @@ -2139,8 +2266,21 @@ namespace Firebird StatusType::checkException(status); } + template void free_1(StatusType* status) + { + StatusType::clearException(status); + static_cast(this->cloopVTable)->free_1(this, status); + StatusType::checkException(status); + } + template void free(StatusType* status) { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "IRequest", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } StatusType::clearException(status); static_cast(this->cloopVTable)->free(this, status); StatusType::checkException(status); @@ -2152,6 +2292,7 @@ namespace Firebird public: struct VTable : public IReferenceCounted::VTable { + void (CLOOP_CARG *cancel_1)(IEvents* self, IStatus* status) throw(); void (CLOOP_CARG *cancel)(IEvents* self, IStatus* status) throw(); }; @@ -2166,10 +2307,23 @@ namespace Firebird } public: - static const unsigned VERSION = 3; + static const unsigned VERSION = 4; + + template void cancel_1(StatusType* status) + { + StatusType::clearException(status); + static_cast(this->cloopVTable)->cancel_1(this, status); + StatusType::checkException(status); + } template void cancel(StatusType* status) { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "IEvents", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } StatusType::clearException(status); static_cast(this->cloopVTable)->cancel(this, status); StatusType::checkException(status); @@ -2197,14 +2351,16 @@ namespace Firebird IEvents* (CLOOP_CARG *queEvents)(IAttachment* self, IStatus* status, IEventCallback* callback, unsigned length, const unsigned char* events) throw(); void (CLOOP_CARG *cancelOperation)(IAttachment* self, IStatus* status, int option) throw(); void (CLOOP_CARG *ping)(IAttachment* self, IStatus* status) throw(); - void (CLOOP_CARG *detach)(IAttachment* self, IStatus* status) throw(); - void (CLOOP_CARG *dropDatabase)(IAttachment* self, IStatus* status) throw(); + void (CLOOP_CARG *detach_1)(IAttachment* self, IStatus* status) throw(); + void (CLOOP_CARG *dropDatabase_1)(IAttachment* self, IStatus* status) throw(); unsigned (CLOOP_CARG *getIdleTimeout)(IAttachment* self, IStatus* status) throw(); void (CLOOP_CARG *setIdleTimeout)(IAttachment* self, IStatus* status, unsigned timeOut) throw(); unsigned (CLOOP_CARG *getStatementTimeout)(IAttachment* self, IStatus* status) throw(); void (CLOOP_CARG *setStatementTimeout)(IAttachment* self, IStatus* status, unsigned timeOut) throw(); IBatch* (CLOOP_CARG *createBatch)(IAttachment* self, IStatus* status, ITransaction* transaction, unsigned stmtLength, const char* sqlStmt, unsigned dialect, IMessageMetadata* inMetadata, unsigned parLength, const unsigned char* par) throw(); IReplicator* (CLOOP_CARG *createReplicator)(IAttachment* self, IStatus* status) throw(); + void (CLOOP_CARG *detach)(IAttachment* self, IStatus* status) throw(); + void (CLOOP_CARG *dropDatabase)(IAttachment* self, IStatus* status) throw(); }; protected: @@ -2218,7 +2374,7 @@ namespace Firebird } public: - static const unsigned VERSION = 4; + static const unsigned VERSION = 5; template void getInfo(StatusType* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) { @@ -2342,17 +2498,17 @@ namespace Firebird StatusType::checkException(status); } - template void detach(StatusType* status) + template void detach_1(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->detach(this, status); + static_cast(this->cloopVTable)->detach_1(this, status); StatusType::checkException(status); } - template void dropDatabase(StatusType* status) + template void dropDatabase_1(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->dropDatabase(this, status); + static_cast(this->cloopVTable)->dropDatabase_1(this, status); StatusType::checkException(status); } @@ -2437,6 +2593,32 @@ namespace Firebird StatusType::checkException(status); return ret; } + + template void detach(StatusType* status) + { + if (cloopVTable->version < 5) + { + StatusType::setVersionError(status, "IAttachment", cloopVTable->version, 5); + StatusType::checkException(status); + return; + } + StatusType::clearException(status); + static_cast(this->cloopVTable)->detach(this, status); + StatusType::checkException(status); + } + + template void dropDatabase(StatusType* status) + { + if (cloopVTable->version < 5) + { + StatusType::setVersionError(status, "IAttachment", cloopVTable->version, 5); + StatusType::checkException(status); + return; + } + StatusType::clearException(status); + static_cast(this->cloopVTable)->dropDatabase(this, status); + StatusType::checkException(status); + } }; class IService : public IReferenceCounted @@ -2444,9 +2626,10 @@ namespace Firebird public: struct VTable : public IReferenceCounted::VTable { - void (CLOOP_CARG *detach)(IService* self, IStatus* status) throw(); + void (CLOOP_CARG *detach_1)(IService* self, IStatus* status) throw(); void (CLOOP_CARG *query)(IService* self, IStatus* status, unsigned sendLength, const unsigned char* sendItems, unsigned receiveLength, const unsigned char* receiveItems, unsigned bufferLength, unsigned char* buffer) throw(); void (CLOOP_CARG *start)(IService* self, IStatus* status, unsigned spbLength, const unsigned char* spb) throw(); + void (CLOOP_CARG *detach)(IService* self, IStatus* status) throw(); }; protected: @@ -2460,12 +2643,12 @@ namespace Firebird } public: - static const unsigned VERSION = 3; + static const unsigned VERSION = 4; - template void detach(StatusType* status) + template void detach_1(StatusType* status) { StatusType::clearException(status); - static_cast(this->cloopVTable)->detach(this, status); + static_cast(this->cloopVTable)->detach_1(this, status); StatusType::checkException(status); } @@ -2482,6 +2665,19 @@ namespace Firebird static_cast(this->cloopVTable)->start(this, status, spbLength, spb); StatusType::checkException(status); } + + template void detach(StatusType* status) + { + if (cloopVTable->version < 4) + { + StatusType::setVersionError(status, "IService", cloopVTable->version, 4); + StatusType::checkException(status); + return; + } + StatusType::clearException(status); + static_cast(this->cloopVTable)->detach(this, status); + StatusType::checkException(status); + } }; class IProvider : public IPluginBase @@ -8219,9 +8415,11 @@ namespace Firebird this->getInfo = &Name::cloopgetInfoDispatcher; this->getSegment = &Name::cloopgetSegmentDispatcher; this->putSegment = &Name::cloopputSegmentDispatcher; + this->cancel_1 = &Name::cloopcancel_1Dispatcher; + this->close_1 = &Name::cloopclose_1Dispatcher; + this->seek = &Name::cloopseekDispatcher; this->cancel = &Name::cloopcancelDispatcher; this->close = &Name::cloopcloseDispatcher; - this->seek = &Name::cloopseekDispatcher; } } vTable; @@ -8271,6 +8469,49 @@ namespace Firebird } } + static void CLOOP_CARG cloopcancel_1Dispatcher(IBlob* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::cancel_1(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + + static void CLOOP_CARG cloopclose_1Dispatcher(IBlob* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::close_1(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + + static int CLOOP_CARG cloopseekDispatcher(IBlob* self, IStatus* status, int mode, int offset) throw() + { + StatusType status2(status); + + try + { + return static_cast(self)->Name::seek(&status2, mode, offset); + } + catch (...) + { + StatusType::catchException(&status2); + return static_cast(0); + } + } + static void CLOOP_CARG cloopcancelDispatcher(IBlob* self, IStatus* status) throw() { StatusType status2(status); @@ -8299,21 +8540,6 @@ namespace Firebird } } - static int CLOOP_CARG cloopseekDispatcher(IBlob* self, IStatus* status, int mode, int offset) throw() - { - StatusType status2(status); - - try - { - return static_cast(self)->Name::seek(&status2, mode, offset); - } - catch (...) - { - StatusType::catchException(&status2); - return static_cast(0); - } - } - static void CLOOP_CARG cloopaddRefDispatcher(IReferenceCounted* self) throw() { try @@ -8356,9 +8582,11 @@ namespace Firebird virtual void getInfo(StatusType* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) = 0; virtual int getSegment(StatusType* status, unsigned bufferLength, void* buffer, unsigned* segmentLength) = 0; virtual void putSegment(StatusType* status, unsigned length, const void* buffer) = 0; + virtual void cancel_1(StatusType* status) = 0; + virtual void close_1(StatusType* status) = 0; + virtual int seek(StatusType* status, int mode, int offset) = 0; virtual void cancel(StatusType* status) = 0; virtual void close(StatusType* status) = 0; - virtual int seek(StatusType* status, int mode, int offset) = 0; }; template @@ -8378,14 +8606,17 @@ namespace Firebird this->release = &Name::cloopreleaseDispatcher; this->getInfo = &Name::cloopgetInfoDispatcher; this->prepare = &Name::cloopprepareDispatcher; - this->commit = &Name::cloopcommitDispatcher; + this->commit_1 = &Name::cloopcommit_1Dispatcher; this->commitRetaining = &Name::cloopcommitRetainingDispatcher; - this->rollback = &Name::clooprollbackDispatcher; + this->rollback_1 = &Name::clooprollback_1Dispatcher; this->rollbackRetaining = &Name::clooprollbackRetainingDispatcher; - this->disconnect = &Name::cloopdisconnectDispatcher; + this->disconnect_1 = &Name::cloopdisconnect_1Dispatcher; this->join = &Name::cloopjoinDispatcher; this->validate = &Name::cloopvalidateDispatcher; this->enterDtc = &Name::cloopenterDtcDispatcher; + this->commit = &Name::cloopcommitDispatcher; + this->rollback = &Name::clooprollbackDispatcher; + this->disconnect = &Name::cloopdisconnectDispatcher; } } vTable; @@ -8420,13 +8651,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopcommitDispatcher(ITransaction* self, IStatus* status) throw() + static void CLOOP_CARG cloopcommit_1Dispatcher(ITransaction* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::commit(&status2); + static_cast(self)->Name::commit_1(&status2); } catch (...) { @@ -8448,13 +8679,13 @@ namespace Firebird } } - static void CLOOP_CARG clooprollbackDispatcher(ITransaction* self, IStatus* status) throw() + static void CLOOP_CARG clooprollback_1Dispatcher(ITransaction* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::rollback(&status2); + static_cast(self)->Name::rollback_1(&status2); } catch (...) { @@ -8476,13 +8707,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopdisconnectDispatcher(ITransaction* self, IStatus* status) throw() + static void CLOOP_CARG cloopdisconnect_1Dispatcher(ITransaction* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::disconnect(&status2); + static_cast(self)->Name::disconnect_1(&status2); } catch (...) { @@ -8535,6 +8766,48 @@ namespace Firebird } } + static void CLOOP_CARG cloopcommitDispatcher(ITransaction* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::commit(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + + static void CLOOP_CARG clooprollbackDispatcher(ITransaction* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::rollback(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + + static void CLOOP_CARG cloopdisconnectDispatcher(ITransaction* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::disconnect(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + static void CLOOP_CARG cloopaddRefDispatcher(IReferenceCounted* self) throw() { try @@ -8576,14 +8849,17 @@ namespace Firebird virtual void getInfo(StatusType* status, unsigned itemsLength, const unsigned char* items, unsigned bufferLength, unsigned char* buffer) = 0; virtual void prepare(StatusType* status, unsigned msgLength, const unsigned char* message) = 0; - virtual void commit(StatusType* status) = 0; + virtual void commit_1(StatusType* status) = 0; virtual void commitRetaining(StatusType* status) = 0; - virtual void rollback(StatusType* status) = 0; + virtual void rollback_1(StatusType* status) = 0; virtual void rollbackRetaining(StatusType* status) = 0; - virtual void disconnect(StatusType* status) = 0; + virtual void disconnect_1(StatusType* status) = 0; virtual ITransaction* join(StatusType* status, ITransaction* transaction) = 0; virtual ITransaction* validate(StatusType* status, IAttachment* attachment) = 0; virtual ITransaction* enterDtc(StatusType* status) = 0; + virtual void commit(StatusType* status) = 0; + virtual void rollback(StatusType* status) = 0; + virtual void disconnect(StatusType* status) = 0; }; template @@ -9249,8 +9525,9 @@ namespace Firebird this->isEof = &Name::cloopisEofDispatcher; this->isBof = &Name::cloopisBofDispatcher; this->getMetadata = &Name::cloopgetMetadataDispatcher; - this->close = &Name::cloopcloseDispatcher; + this->close_1 = &Name::cloopclose_1Dispatcher; this->setDelayedOutputFormat = &Name::cloopsetDelayedOutputFormatDispatcher; + this->close = &Name::cloopcloseDispatcher; } } vTable; @@ -9392,13 +9669,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopcloseDispatcher(IResultSet* self, IStatus* status) throw() + static void CLOOP_CARG cloopclose_1Dispatcher(IResultSet* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::close(&status2); + static_cast(self)->Name::close_1(&status2); } catch (...) { @@ -9420,6 +9697,20 @@ namespace Firebird } } + static void CLOOP_CARG cloopcloseDispatcher(IResultSet* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::close(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + static void CLOOP_CARG cloopaddRefDispatcher(IReferenceCounted* self) throw() { try @@ -9468,8 +9759,9 @@ namespace Firebird virtual FB_BOOLEAN isEof(StatusType* status) = 0; virtual FB_BOOLEAN isBof(StatusType* status) = 0; virtual IMessageMetadata* getMetadata(StatusType* status) = 0; - virtual void close(StatusType* status) = 0; + virtual void close_1(StatusType* status) = 0; virtual void setDelayedOutputFormat(StatusType* status, IMessageMetadata* format) = 0; + virtual void close(StatusType* status) = 0; }; template @@ -9496,11 +9788,12 @@ namespace Firebird this->execute = &Name::cloopexecuteDispatcher; this->openCursor = &Name::cloopopenCursorDispatcher; this->setCursorName = &Name::cloopsetCursorNameDispatcher; - this->free = &Name::cloopfreeDispatcher; + this->free_1 = &Name::cloopfree_1Dispatcher; this->getFlags = &Name::cloopgetFlagsDispatcher; this->getTimeout = &Name::cloopgetTimeoutDispatcher; this->setTimeout = &Name::cloopsetTimeoutDispatcher; this->createBatch = &Name::cloopcreateBatchDispatcher; + this->free = &Name::cloopfreeDispatcher; } } vTable; @@ -9640,13 +9933,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopfreeDispatcher(IStatement* self, IStatus* status) throw() + static void CLOOP_CARG cloopfree_1Dispatcher(IStatement* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::free(&status2); + static_cast(self)->Name::free_1(&status2); } catch (...) { @@ -9713,6 +10006,20 @@ namespace Firebird } } + static void CLOOP_CARG cloopfreeDispatcher(IStatement* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::free(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + static void CLOOP_CARG cloopaddRefDispatcher(IReferenceCounted* self) throw() { try @@ -9761,11 +10068,12 @@ namespace Firebird virtual ITransaction* execute(StatusType* status, ITransaction* transaction, IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outMetadata, void* outBuffer) = 0; virtual IResultSet* openCursor(StatusType* status, ITransaction* transaction, IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outMetadata, unsigned flags) = 0; virtual void setCursorName(StatusType* status, const char* name) = 0; - virtual void free(StatusType* status) = 0; + virtual void free_1(StatusType* status) = 0; virtual unsigned getFlags(StatusType* status) = 0; virtual unsigned getTimeout(StatusType* status) = 0; virtual void setTimeout(StatusType* status, unsigned timeOut) = 0; virtual IBatch* createBatch(StatusType* status, IMessageMetadata* inMetadata, unsigned parLength, const unsigned char* par) = 0; + virtual void free(StatusType* status) = 0; }; template @@ -9793,6 +10101,7 @@ namespace Firebird this->getBlobAlignment = &Name::cloopgetBlobAlignmentDispatcher; this->getMetadata = &Name::cloopgetMetadataDispatcher; this->setDefaultBpb = &Name::cloopsetDefaultBpbDispatcher; + this->close_1 = &Name::cloopclose_1Dispatcher; this->close = &Name::cloopcloseDispatcher; } } vTable; @@ -9943,6 +10252,20 @@ namespace Firebird } } + static void CLOOP_CARG cloopclose_1Dispatcher(IBatch* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::close_1(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + static void CLOOP_CARG cloopcloseDispatcher(IBatch* self, IStatus* status) throw() { StatusType status2(status); @@ -10006,6 +10329,7 @@ namespace Firebird virtual unsigned getBlobAlignment(StatusType* status) = 0; virtual IMessageMetadata* getMetadata(StatusType* status) = 0; virtual void setDefaultBpb(StatusType* status, unsigned parLength, const unsigned char* par) = 0; + virtual void close_1(StatusType* status) = 0; virtual void close(StatusType* status) = 0; }; @@ -10140,6 +10464,7 @@ namespace Firebird this->addRef = &Name::cloopaddRefDispatcher; this->release = &Name::cloopreleaseDispatcher; this->process = &Name::cloopprocessDispatcher; + this->close_1 = &Name::cloopclose_1Dispatcher; this->close = &Name::cloopcloseDispatcher; } } vTable; @@ -10161,6 +10486,20 @@ namespace Firebird } } + static void CLOOP_CARG cloopclose_1Dispatcher(IReplicator* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::close_1(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + static void CLOOP_CARG cloopcloseDispatcher(IReplicator* self, IStatus* status) throw() { StatusType status2(status); @@ -10215,6 +10554,7 @@ namespace Firebird } virtual void process(StatusType* status, unsigned length, const unsigned char* data) = 0; + virtual void close_1(StatusType* status) = 0; virtual void close(StatusType* status) = 0; }; @@ -10239,6 +10579,7 @@ namespace Firebird this->start = &Name::cloopstartDispatcher; this->startAndSend = &Name::cloopstartAndSendDispatcher; this->unwind = &Name::cloopunwindDispatcher; + this->free_1 = &Name::cloopfree_1Dispatcher; this->free = &Name::cloopfreeDispatcher; } } vTable; @@ -10330,6 +10671,20 @@ namespace Firebird } } + static void CLOOP_CARG cloopfree_1Dispatcher(IRequest* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::free_1(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + static void CLOOP_CARG cloopfreeDispatcher(IRequest* self, IStatus* status) throw() { StatusType status2(status); @@ -10389,6 +10744,7 @@ namespace Firebird virtual void start(StatusType* status, ITransaction* tra, int level) = 0; virtual void startAndSend(StatusType* status, ITransaction* tra, int level, unsigned msgType, unsigned length, const void* message) = 0; virtual void unwind(StatusType* status, int level) = 0; + virtual void free_1(StatusType* status) = 0; virtual void free(StatusType* status) = 0; }; @@ -10407,6 +10763,7 @@ namespace Firebird this->version = Base::VERSION; this->addRef = &Name::cloopaddRefDispatcher; this->release = &Name::cloopreleaseDispatcher; + this->cancel_1 = &Name::cloopcancel_1Dispatcher; this->cancel = &Name::cloopcancelDispatcher; } } vTable; @@ -10414,6 +10771,20 @@ namespace Firebird this->cloopVTable = &vTable; } + static void CLOOP_CARG cloopcancel_1Dispatcher(IEvents* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::cancel_1(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + static void CLOOP_CARG cloopcancelDispatcher(IEvents* self, IStatus* status) throw() { StatusType status2(status); @@ -10467,6 +10838,7 @@ namespace Firebird { } + virtual void cancel_1(StatusType* status) = 0; virtual void cancel(StatusType* status) = 0; }; @@ -10501,14 +10873,16 @@ namespace Firebird this->queEvents = &Name::cloopqueEventsDispatcher; this->cancelOperation = &Name::cloopcancelOperationDispatcher; this->ping = &Name::clooppingDispatcher; - this->detach = &Name::cloopdetachDispatcher; - this->dropDatabase = &Name::cloopdropDatabaseDispatcher; + this->detach_1 = &Name::cloopdetach_1Dispatcher; + this->dropDatabase_1 = &Name::cloopdropDatabase_1Dispatcher; this->getIdleTimeout = &Name::cloopgetIdleTimeoutDispatcher; this->setIdleTimeout = &Name::cloopsetIdleTimeoutDispatcher; this->getStatementTimeout = &Name::cloopgetStatementTimeoutDispatcher; this->setStatementTimeout = &Name::cloopsetStatementTimeoutDispatcher; this->createBatch = &Name::cloopcreateBatchDispatcher; this->createReplicator = &Name::cloopcreateReplicatorDispatcher; + this->detach = &Name::cloopdetachDispatcher; + this->dropDatabase = &Name::cloopdropDatabaseDispatcher; } } vTable; @@ -10749,13 +11123,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopdetachDispatcher(IAttachment* self, IStatus* status) throw() + static void CLOOP_CARG cloopdetach_1Dispatcher(IAttachment* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::detach(&status2); + static_cast(self)->Name::detach_1(&status2); } catch (...) { @@ -10763,13 +11137,13 @@ namespace Firebird } } - static void CLOOP_CARG cloopdropDatabaseDispatcher(IAttachment* self, IStatus* status) throw() + static void CLOOP_CARG cloopdropDatabase_1Dispatcher(IAttachment* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::dropDatabase(&status2); + static_cast(self)->Name::dropDatabase_1(&status2); } catch (...) { @@ -10865,6 +11239,34 @@ namespace Firebird } } + static void CLOOP_CARG cloopdetachDispatcher(IAttachment* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::detach(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + + static void CLOOP_CARG cloopdropDatabaseDispatcher(IAttachment* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::dropDatabase(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + static void CLOOP_CARG cloopaddRefDispatcher(IReferenceCounted* self) throw() { try @@ -10920,14 +11322,16 @@ namespace Firebird virtual IEvents* queEvents(StatusType* status, IEventCallback* callback, unsigned length, const unsigned char* events) = 0; virtual void cancelOperation(StatusType* status, int option) = 0; virtual void ping(StatusType* status) = 0; - virtual void detach(StatusType* status) = 0; - virtual void dropDatabase(StatusType* status) = 0; + virtual void detach_1(StatusType* status) = 0; + virtual void dropDatabase_1(StatusType* status) = 0; virtual unsigned getIdleTimeout(StatusType* status) = 0; virtual void setIdleTimeout(StatusType* status, unsigned timeOut) = 0; virtual unsigned getStatementTimeout(StatusType* status) = 0; virtual void setStatementTimeout(StatusType* status, unsigned timeOut) = 0; virtual IBatch* createBatch(StatusType* status, ITransaction* transaction, unsigned stmtLength, const char* sqlStmt, unsigned dialect, IMessageMetadata* inMetadata, unsigned parLength, const unsigned char* par) = 0; virtual IReplicator* createReplicator(StatusType* status) = 0; + virtual void detach(StatusType* status) = 0; + virtual void dropDatabase(StatusType* status) = 0; }; template @@ -10945,22 +11349,23 @@ namespace Firebird this->version = Base::VERSION; this->addRef = &Name::cloopaddRefDispatcher; this->release = &Name::cloopreleaseDispatcher; - this->detach = &Name::cloopdetachDispatcher; + this->detach_1 = &Name::cloopdetach_1Dispatcher; this->query = &Name::cloopqueryDispatcher; this->start = &Name::cloopstartDispatcher; + this->detach = &Name::cloopdetachDispatcher; } } vTable; this->cloopVTable = &vTable; } - static void CLOOP_CARG cloopdetachDispatcher(IService* self, IStatus* status) throw() + static void CLOOP_CARG cloopdetach_1Dispatcher(IService* self, IStatus* status) throw() { StatusType status2(status); try { - static_cast(self)->Name::detach(&status2); + static_cast(self)->Name::detach_1(&status2); } catch (...) { @@ -10996,6 +11401,20 @@ namespace Firebird } } + static void CLOOP_CARG cloopdetachDispatcher(IService* self, IStatus* status) throw() + { + StatusType status2(status); + + try + { + static_cast(self)->Name::detach(&status2); + } + catch (...) + { + StatusType::catchException(&status2); + } + } + static void CLOOP_CARG cloopaddRefDispatcher(IReferenceCounted* self) throw() { try @@ -11035,9 +11454,10 @@ namespace Firebird { } - virtual void detach(StatusType* status) = 0; + virtual void detach_1(StatusType* status) = 0; virtual void query(StatusType* status, unsigned sendLength, const unsigned char* sendItems, unsigned receiveLength, const unsigned char* receiveItems, unsigned bufferLength, unsigned char* buffer) = 0; virtual void start(StatusType* status, unsigned spbLength, const unsigned char* spb) = 0; + virtual void detach(StatusType* status) = 0; }; template diff --git a/src/include/gen/Firebird.pas b/src/include/gen/Firebird.pas index 0cc1fd5542..f98fbb9295 100644 --- a/src/include/gen/Firebird.pas +++ b/src/include/gen/Firebird.pas @@ -276,19 +276,24 @@ type IBlob_getInfoPtr = procedure(this: IBlob; status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); cdecl; IBlob_getSegmentPtr = function(this: IBlob; status: IStatus; bufferLength: Cardinal; buffer: Pointer; segmentLength: CardinalPtr): Integer; cdecl; IBlob_putSegmentPtr = procedure(this: IBlob; status: IStatus; length: Cardinal; buffer: Pointer); cdecl; + IBlob_cancel_1Ptr = procedure(this: IBlob; status: IStatus); cdecl; + IBlob_close_1Ptr = procedure(this: IBlob; status: IStatus); cdecl; + IBlob_seekPtr = function(this: IBlob; status: IStatus; mode: Integer; offset: Integer): Integer; cdecl; IBlob_cancelPtr = procedure(this: IBlob; status: IStatus); cdecl; IBlob_closePtr = procedure(this: IBlob; status: IStatus); cdecl; - IBlob_seekPtr = function(this: IBlob; status: IStatus; mode: Integer; offset: Integer): Integer; cdecl; ITransaction_getInfoPtr = procedure(this: ITransaction; status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); cdecl; ITransaction_preparePtr = procedure(this: ITransaction; status: IStatus; msgLength: Cardinal; message: BytePtr); cdecl; - ITransaction_commitPtr = procedure(this: ITransaction; status: IStatus); cdecl; + ITransaction_commit_1Ptr = procedure(this: ITransaction; status: IStatus); cdecl; ITransaction_commitRetainingPtr = procedure(this: ITransaction; status: IStatus); cdecl; - ITransaction_rollbackPtr = procedure(this: ITransaction; status: IStatus); cdecl; + ITransaction_rollback_1Ptr = procedure(this: ITransaction; status: IStatus); cdecl; ITransaction_rollbackRetainingPtr = procedure(this: ITransaction; status: IStatus); cdecl; - ITransaction_disconnectPtr = procedure(this: ITransaction; status: IStatus); cdecl; + ITransaction_disconnect_1Ptr = procedure(this: ITransaction; status: IStatus); cdecl; ITransaction_joinPtr = function(this: ITransaction; status: IStatus; transaction: ITransaction): ITransaction; cdecl; ITransaction_validatePtr = function(this: ITransaction; status: IStatus; attachment: IAttachment): ITransaction; cdecl; ITransaction_enterDtcPtr = function(this: ITransaction; status: IStatus): ITransaction; cdecl; + ITransaction_commitPtr = procedure(this: ITransaction; status: IStatus); cdecl; + ITransaction_rollbackPtr = procedure(this: ITransaction; status: IStatus); cdecl; + ITransaction_disconnectPtr = procedure(this: ITransaction; status: IStatus); cdecl; IMessageMetadata_getCountPtr = function(this: IMessageMetadata; status: IStatus): Cardinal; cdecl; IMessageMetadata_getFieldPtr = function(this: IMessageMetadata; status: IStatus; index: Cardinal): PAnsiChar; cdecl; IMessageMetadata_getRelationPtr = function(this: IMessageMetadata; status: IStatus; index: Cardinal): PAnsiChar; cdecl; @@ -329,8 +334,9 @@ type IResultSet_isEofPtr = function(this: IResultSet; status: IStatus): Boolean; cdecl; IResultSet_isBofPtr = function(this: IResultSet; status: IStatus): Boolean; cdecl; IResultSet_getMetadataPtr = function(this: IResultSet; status: IStatus): IMessageMetadata; cdecl; - IResultSet_closePtr = procedure(this: IResultSet; status: IStatus); cdecl; + IResultSet_close_1Ptr = procedure(this: IResultSet; status: IStatus); cdecl; IResultSet_setDelayedOutputFormatPtr = procedure(this: IResultSet; status: IStatus; format: IMessageMetadata); cdecl; + IResultSet_closePtr = procedure(this: IResultSet; status: IStatus); cdecl; IStatement_getInfoPtr = procedure(this: IStatement; status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); cdecl; IStatement_getTypePtr = function(this: IStatement; status: IStatus): Cardinal; cdecl; IStatement_getPlanPtr = function(this: IStatement; status: IStatus; detailed: Boolean): PAnsiChar; cdecl; @@ -340,11 +346,12 @@ type IStatement_executePtr = function(this: IStatement; status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; outBuffer: Pointer): ITransaction; cdecl; IStatement_openCursorPtr = function(this: IStatement; status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; flags: Cardinal): IResultSet; cdecl; IStatement_setCursorNamePtr = procedure(this: IStatement; status: IStatus; name: PAnsiChar); cdecl; - IStatement_freePtr = procedure(this: IStatement; status: IStatus); cdecl; + IStatement_free_1Ptr = procedure(this: IStatement; status: IStatus); cdecl; IStatement_getFlagsPtr = function(this: IStatement; status: IStatus): Cardinal; cdecl; IStatement_getTimeoutPtr = function(this: IStatement; status: IStatus): Cardinal; cdecl; IStatement_setTimeoutPtr = procedure(this: IStatement; status: IStatus; timeOut: Cardinal); cdecl; IStatement_createBatchPtr = function(this: IStatement; status: IStatus; inMetadata: IMessageMetadata; parLength: Cardinal; par: BytePtr): IBatch; cdecl; + IStatement_freePtr = procedure(this: IStatement; status: IStatus); cdecl; IBatch_addPtr = procedure(this: IBatch; status: IStatus; count: Cardinal; inBuffer: Pointer); cdecl; IBatch_addBlobPtr = procedure(this: IBatch; status: IStatus; length: Cardinal; inBuffer: Pointer; blobId: ISC_QUADPtr; parLength: Cardinal; par: BytePtr); cdecl; IBatch_appendBlobDataPtr = procedure(this: IBatch; status: IStatus; length: Cardinal; inBuffer: Pointer); cdecl; @@ -355,12 +362,14 @@ type IBatch_getBlobAlignmentPtr = function(this: IBatch; status: IStatus): Cardinal; cdecl; IBatch_getMetadataPtr = function(this: IBatch; status: IStatus): IMessageMetadata; cdecl; IBatch_setDefaultBpbPtr = procedure(this: IBatch; status: IStatus; parLength: Cardinal; par: BytePtr); cdecl; + IBatch_close_1Ptr = procedure(this: IBatch; status: IStatus); cdecl; IBatch_closePtr = procedure(this: IBatch; status: IStatus); cdecl; IBatchCompletionState_getSizePtr = function(this: IBatchCompletionState; status: IStatus): Cardinal; cdecl; IBatchCompletionState_getStatePtr = function(this: IBatchCompletionState; status: IStatus; pos: Cardinal): Integer; cdecl; IBatchCompletionState_findErrorPtr = function(this: IBatchCompletionState; status: IStatus; pos: Cardinal): Cardinal; cdecl; IBatchCompletionState_getStatusPtr = procedure(this: IBatchCompletionState; status: IStatus; to_: IStatus; pos: Cardinal); cdecl; IReplicator_processPtr = procedure(this: IReplicator; status: IStatus; length: Cardinal; data: BytePtr); cdecl; + IReplicator_close_1Ptr = procedure(this: IReplicator; status: IStatus); cdecl; IReplicator_closePtr = procedure(this: IReplicator; status: IStatus); cdecl; IRequest_receivePtr = procedure(this: IRequest; status: IStatus; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); cdecl; IRequest_sendPtr = procedure(this: IRequest; status: IStatus; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); cdecl; @@ -368,7 +377,9 @@ type IRequest_startPtr = procedure(this: IRequest; status: IStatus; tra: ITransaction; level: Integer); cdecl; IRequest_startAndSendPtr = procedure(this: IRequest; status: IStatus; tra: ITransaction; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); cdecl; IRequest_unwindPtr = procedure(this: IRequest; status: IStatus; level: Integer); cdecl; + IRequest_free_1Ptr = procedure(this: IRequest; status: IStatus); cdecl; IRequest_freePtr = procedure(this: IRequest; status: IStatus); cdecl; + IEvents_cancel_1Ptr = procedure(this: IEvents; status: IStatus); cdecl; IEvents_cancelPtr = procedure(this: IEvents; status: IStatus); cdecl; IAttachment_getInfoPtr = procedure(this: IAttachment; status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); cdecl; IAttachment_startTransactionPtr = function(this: IAttachment; status: IStatus; tpbLength: Cardinal; tpb: BytePtr): ITransaction; cdecl; @@ -386,17 +397,20 @@ type IAttachment_queEventsPtr = function(this: IAttachment; status: IStatus; callback: IEventCallback; length: Cardinal; events: BytePtr): IEvents; cdecl; IAttachment_cancelOperationPtr = procedure(this: IAttachment; status: IStatus; option: Integer); cdecl; IAttachment_pingPtr = procedure(this: IAttachment; status: IStatus); cdecl; - IAttachment_detachPtr = procedure(this: IAttachment; status: IStatus); cdecl; - IAttachment_dropDatabasePtr = procedure(this: IAttachment; status: IStatus); cdecl; + IAttachment_detach_1Ptr = procedure(this: IAttachment; status: IStatus); cdecl; + IAttachment_dropDatabase_1Ptr = procedure(this: IAttachment; status: IStatus); cdecl; IAttachment_getIdleTimeoutPtr = function(this: IAttachment; status: IStatus): Cardinal; cdecl; IAttachment_setIdleTimeoutPtr = procedure(this: IAttachment; status: IStatus; timeOut: Cardinal); cdecl; IAttachment_getStatementTimeoutPtr = function(this: IAttachment; status: IStatus): Cardinal; cdecl; IAttachment_setStatementTimeoutPtr = procedure(this: IAttachment; status: IStatus; timeOut: Cardinal); cdecl; IAttachment_createBatchPtr = function(this: IAttachment; status: IStatus; transaction: ITransaction; stmtLength: Cardinal; sqlStmt: PAnsiChar; dialect: Cardinal; inMetadata: IMessageMetadata; parLength: Cardinal; par: BytePtr): IBatch; cdecl; IAttachment_createReplicatorPtr = function(this: IAttachment; status: IStatus): IReplicator; cdecl; - IService_detachPtr = procedure(this: IService; status: IStatus); cdecl; + IAttachment_detachPtr = procedure(this: IAttachment; status: IStatus); cdecl; + IAttachment_dropDatabasePtr = procedure(this: IAttachment; status: IStatus); cdecl; + IService_detach_1Ptr = procedure(this: IService; status: IStatus); cdecl; IService_queryPtr = procedure(this: IService; status: IStatus; sendLength: Cardinal; sendItems: BytePtr; receiveLength: Cardinal; receiveItems: BytePtr; bufferLength: Cardinal; buffer: BytePtr); cdecl; IService_startPtr = procedure(this: IService; status: IStatus; spbLength: Cardinal; spb: BytePtr); cdecl; + IService_detachPtr = procedure(this: IService; status: IStatus); cdecl; IProvider_attachDatabasePtr = function(this: IProvider; status: IStatus; fileName: PAnsiChar; dpbLength: Cardinal; dpb: BytePtr): IAttachment; cdecl; IProvider_createDatabasePtr = function(this: IProvider; status: IStatus; fileName: PAnsiChar; dpbLength: Cardinal; dpb: BytePtr): IAttachment; cdecl; IProvider_attachServiceManagerPtr = function(this: IProvider; status: IStatus; service: PAnsiChar; spbLength: Cardinal; spb: BytePtr): IService; cdecl; @@ -1183,20 +1197,24 @@ type getInfo: IBlob_getInfoPtr; getSegment: IBlob_getSegmentPtr; putSegment: IBlob_putSegmentPtr; + cancel_1: IBlob_cancel_1Ptr; + close_1: IBlob_close_1Ptr; + seek: IBlob_seekPtr; cancel: IBlob_cancelPtr; close: IBlob_closePtr; - seek: IBlob_seekPtr; end; IBlob = class(IReferenceCounted) - const VERSION = 3; + const VERSION = 4; procedure getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); function getSegment(status: IStatus; bufferLength: Cardinal; buffer: Pointer; segmentLength: CardinalPtr): Integer; procedure putSegment(status: IStatus; length: Cardinal; buffer: Pointer); + procedure cancel_1(status: IStatus); + procedure close_1(status: IStatus); + function seek(status: IStatus; mode: Integer; offset: Integer): Integer; procedure cancel(status: IStatus); procedure close(status: IStatus); - function seek(status: IStatus; mode: Integer; offset: Integer): Integer; end; IBlobImpl = class(IBlob) @@ -1207,37 +1225,45 @@ type procedure getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); virtual; abstract; function getSegment(status: IStatus; bufferLength: Cardinal; buffer: Pointer; segmentLength: CardinalPtr): Integer; virtual; abstract; procedure putSegment(status: IStatus; length: Cardinal; buffer: Pointer); virtual; abstract; + procedure cancel_1(status: IStatus); virtual; abstract; + procedure close_1(status: IStatus); virtual; abstract; + function seek(status: IStatus; mode: Integer; offset: Integer): Integer; virtual; abstract; procedure cancel(status: IStatus); virtual; abstract; procedure close(status: IStatus); virtual; abstract; - function seek(status: IStatus; mode: Integer; offset: Integer): Integer; virtual; abstract; end; TransactionVTable = class(ReferenceCountedVTable) getInfo: ITransaction_getInfoPtr; prepare: ITransaction_preparePtr; - commit: ITransaction_commitPtr; + commit_1: ITransaction_commit_1Ptr; commitRetaining: ITransaction_commitRetainingPtr; - rollback: ITransaction_rollbackPtr; + rollback_1: ITransaction_rollback_1Ptr; rollbackRetaining: ITransaction_rollbackRetainingPtr; - disconnect: ITransaction_disconnectPtr; + disconnect_1: ITransaction_disconnect_1Ptr; join: ITransaction_joinPtr; validate: ITransaction_validatePtr; enterDtc: ITransaction_enterDtcPtr; + commit: ITransaction_commitPtr; + rollback: ITransaction_rollbackPtr; + disconnect: ITransaction_disconnectPtr; end; ITransaction = class(IReferenceCounted) - const VERSION = 3; + const VERSION = 4; procedure getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); procedure prepare(status: IStatus; msgLength: Cardinal; message: BytePtr); - procedure commit(status: IStatus); + procedure commit_1(status: IStatus); procedure commitRetaining(status: IStatus); - procedure rollback(status: IStatus); + procedure rollback_1(status: IStatus); procedure rollbackRetaining(status: IStatus); - procedure disconnect(status: IStatus); + procedure disconnect_1(status: IStatus); function join(status: IStatus; transaction: ITransaction): ITransaction; function validate(status: IStatus; attachment: IAttachment): ITransaction; function enterDtc(status: IStatus): ITransaction; + procedure commit(status: IStatus); + procedure rollback(status: IStatus); + procedure disconnect(status: IStatus); end; ITransactionImpl = class(ITransaction) @@ -1247,14 +1273,17 @@ type function release(): Integer; virtual; abstract; procedure getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); virtual; abstract; procedure prepare(status: IStatus; msgLength: Cardinal; message: BytePtr); virtual; abstract; - procedure commit(status: IStatus); virtual; abstract; + procedure commit_1(status: IStatus); virtual; abstract; procedure commitRetaining(status: IStatus); virtual; abstract; - procedure rollback(status: IStatus); virtual; abstract; + procedure rollback_1(status: IStatus); virtual; abstract; procedure rollbackRetaining(status: IStatus); virtual; abstract; - procedure disconnect(status: IStatus); virtual; abstract; + procedure disconnect_1(status: IStatus); virtual; abstract; function join(status: IStatus; transaction: ITransaction): ITransaction; virtual; abstract; function validate(status: IStatus; attachment: IAttachment): ITransaction; virtual; abstract; function enterDtc(status: IStatus): ITransaction; virtual; abstract; + procedure commit(status: IStatus); virtual; abstract; + procedure rollback(status: IStatus); virtual; abstract; + procedure disconnect(status: IStatus); virtual; abstract; end; MessageMetadataVTable = class(ReferenceCountedVTable) @@ -1390,12 +1419,13 @@ type isEof: IResultSet_isEofPtr; isBof: IResultSet_isBofPtr; getMetadata: IResultSet_getMetadataPtr; - close: IResultSet_closePtr; + close_1: IResultSet_close_1Ptr; setDelayedOutputFormat: IResultSet_setDelayedOutputFormatPtr; + close: IResultSet_closePtr; end; IResultSet = class(IReferenceCounted) - const VERSION = 3; + const VERSION = 4; function fetchNext(status: IStatus; message: Pointer): Integer; function fetchPrior(status: IStatus; message: Pointer): Integer; @@ -1406,8 +1436,9 @@ type function isEof(status: IStatus): Boolean; function isBof(status: IStatus): Boolean; function getMetadata(status: IStatus): IMessageMetadata; - procedure close(status: IStatus); + procedure close_1(status: IStatus); procedure setDelayedOutputFormat(status: IStatus; format: IMessageMetadata); + procedure close(status: IStatus); end; IResultSetImpl = class(IResultSet) @@ -1424,8 +1455,9 @@ type function isEof(status: IStatus): Boolean; virtual; abstract; function isBof(status: IStatus): Boolean; virtual; abstract; function getMetadata(status: IStatus): IMessageMetadata; virtual; abstract; - procedure close(status: IStatus); virtual; abstract; + procedure close_1(status: IStatus); virtual; abstract; procedure setDelayedOutputFormat(status: IStatus; format: IMessageMetadata); virtual; abstract; + procedure close(status: IStatus); virtual; abstract; end; StatementVTable = class(ReferenceCountedVTable) @@ -1438,15 +1470,16 @@ type execute: IStatement_executePtr; openCursor: IStatement_openCursorPtr; setCursorName: IStatement_setCursorNamePtr; - free: IStatement_freePtr; + free_1: IStatement_free_1Ptr; getFlags: IStatement_getFlagsPtr; getTimeout: IStatement_getTimeoutPtr; setTimeout: IStatement_setTimeoutPtr; createBatch: IStatement_createBatchPtr; + free: IStatement_freePtr; end; IStatement = class(IReferenceCounted) - const VERSION = 4; + const VERSION = 5; const PREPARE_PREFETCH_NONE = Cardinal($0); const PREPARE_PREFETCH_TYPE = Cardinal($1); const PREPARE_PREFETCH_INPUT_PARAMETERS = Cardinal($2); @@ -1470,11 +1503,12 @@ type function execute(status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; outBuffer: Pointer): ITransaction; function openCursor(status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; flags: Cardinal): IResultSet; procedure setCursorName(status: IStatus; name: PAnsiChar); - procedure free(status: IStatus); + procedure free_1(status: IStatus); function getFlags(status: IStatus): Cardinal; function getTimeout(status: IStatus): Cardinal; procedure setTimeout(status: IStatus; timeOut: Cardinal); function createBatch(status: IStatus; inMetadata: IMessageMetadata; parLength: Cardinal; par: BytePtr): IBatch; + procedure free(status: IStatus); end; IStatementImpl = class(IStatement) @@ -1491,11 +1525,12 @@ type function execute(status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; outBuffer: Pointer): ITransaction; virtual; abstract; function openCursor(status: IStatus; transaction: ITransaction; inMetadata: IMessageMetadata; inBuffer: Pointer; outMetadata: IMessageMetadata; flags: Cardinal): IResultSet; virtual; abstract; procedure setCursorName(status: IStatus; name: PAnsiChar); virtual; abstract; - procedure free(status: IStatus); virtual; abstract; + procedure free_1(status: IStatus); virtual; abstract; function getFlags(status: IStatus): Cardinal; virtual; abstract; function getTimeout(status: IStatus): Cardinal; virtual; abstract; procedure setTimeout(status: IStatus; timeOut: Cardinal); virtual; abstract; function createBatch(status: IStatus; inMetadata: IMessageMetadata; parLength: Cardinal; par: BytePtr): IBatch; virtual; abstract; + procedure free(status: IStatus); virtual; abstract; end; BatchVTable = class(ReferenceCountedVTable) @@ -1509,11 +1544,12 @@ type getBlobAlignment: IBatch_getBlobAlignmentPtr; getMetadata: IBatch_getMetadataPtr; setDefaultBpb: IBatch_setDefaultBpbPtr; + close_1: IBatch_close_1Ptr; close: IBatch_closePtr; end; IBatch = class(IReferenceCounted) - const VERSION = 3; + const VERSION = 4; const VERSION1 = Byte(1); const TAG_MULTIERROR = Byte(1); const TAG_RECORD_COUNTS = Byte(2); @@ -1536,6 +1572,7 @@ type function getBlobAlignment(status: IStatus): Cardinal; function getMetadata(status: IStatus): IMessageMetadata; procedure setDefaultBpb(status: IStatus; parLength: Cardinal; par: BytePtr); + procedure close_1(status: IStatus); procedure close(status: IStatus); end; @@ -1554,6 +1591,7 @@ type function getBlobAlignment(status: IStatus): Cardinal; virtual; abstract; function getMetadata(status: IStatus): IMessageMetadata; virtual; abstract; procedure setDefaultBpb(status: IStatus; parLength: Cardinal; par: BytePtr); virtual; abstract; + procedure close_1(status: IStatus); virtual; abstract; procedure close(status: IStatus); virtual; abstract; end; @@ -1588,13 +1626,15 @@ type ReplicatorVTable = class(ReferenceCountedVTable) process: IReplicator_processPtr; + close_1: IReplicator_close_1Ptr; close: IReplicator_closePtr; end; IReplicator = class(IReferenceCounted) - const VERSION = 3; + const VERSION = 4; procedure process(status: IStatus; length: Cardinal; data: BytePtr); + procedure close_1(status: IStatus); procedure close(status: IStatus); end; @@ -1604,6 +1644,7 @@ type procedure addRef(); virtual; abstract; function release(): Integer; virtual; abstract; procedure process(status: IStatus; length: Cardinal; data: BytePtr); virtual; abstract; + procedure close_1(status: IStatus); virtual; abstract; procedure close(status: IStatus); virtual; abstract; end; @@ -1614,11 +1655,12 @@ type start: IRequest_startPtr; startAndSend: IRequest_startAndSendPtr; unwind: IRequest_unwindPtr; + free_1: IRequest_free_1Ptr; free: IRequest_freePtr; end; IRequest = class(IReferenceCounted) - const VERSION = 3; + const VERSION = 4; procedure receive(status: IStatus; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); procedure send(status: IStatus; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); @@ -1626,6 +1668,7 @@ type procedure start(status: IStatus; tra: ITransaction; level: Integer); procedure startAndSend(status: IStatus; tra: ITransaction; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); procedure unwind(status: IStatus; level: Integer); + procedure free_1(status: IStatus); procedure free(status: IStatus); end; @@ -1640,16 +1683,19 @@ type procedure start(status: IStatus; tra: ITransaction; level: Integer); virtual; abstract; procedure startAndSend(status: IStatus; tra: ITransaction; level: Integer; msgType: Cardinal; length: Cardinal; message: Pointer); virtual; abstract; procedure unwind(status: IStatus; level: Integer); virtual; abstract; + procedure free_1(status: IStatus); virtual; abstract; procedure free(status: IStatus); virtual; abstract; end; EventsVTable = class(ReferenceCountedVTable) + cancel_1: IEvents_cancel_1Ptr; cancel: IEvents_cancelPtr; end; IEvents = class(IReferenceCounted) - const VERSION = 3; + const VERSION = 4; + procedure cancel_1(status: IStatus); procedure cancel(status: IStatus); end; @@ -1658,6 +1704,7 @@ type procedure addRef(); virtual; abstract; function release(): Integer; virtual; abstract; + procedure cancel_1(status: IStatus); virtual; abstract; procedure cancel(status: IStatus); virtual; abstract; end; @@ -1678,18 +1725,20 @@ type queEvents: IAttachment_queEventsPtr; cancelOperation: IAttachment_cancelOperationPtr; ping: IAttachment_pingPtr; - detach: IAttachment_detachPtr; - dropDatabase: IAttachment_dropDatabasePtr; + detach_1: IAttachment_detach_1Ptr; + dropDatabase_1: IAttachment_dropDatabase_1Ptr; getIdleTimeout: IAttachment_getIdleTimeoutPtr; setIdleTimeout: IAttachment_setIdleTimeoutPtr; getStatementTimeout: IAttachment_getStatementTimeoutPtr; setStatementTimeout: IAttachment_setStatementTimeoutPtr; createBatch: IAttachment_createBatchPtr; createReplicator: IAttachment_createReplicatorPtr; + detach: IAttachment_detachPtr; + dropDatabase: IAttachment_dropDatabasePtr; end; IAttachment = class(IReferenceCounted) - const VERSION = 4; + const VERSION = 5; procedure getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); function startTransaction(status: IStatus; tpbLength: Cardinal; tpb: BytePtr): ITransaction; @@ -1707,14 +1756,16 @@ type function queEvents(status: IStatus; callback: IEventCallback; length: Cardinal; events: BytePtr): IEvents; procedure cancelOperation(status: IStatus; option: Integer); procedure ping(status: IStatus); - procedure detach(status: IStatus); - procedure dropDatabase(status: IStatus); + procedure detach_1(status: IStatus); + procedure dropDatabase_1(status: IStatus); function getIdleTimeout(status: IStatus): Cardinal; procedure setIdleTimeout(status: IStatus; timeOut: Cardinal); function getStatementTimeout(status: IStatus): Cardinal; procedure setStatementTimeout(status: IStatus; timeOut: Cardinal); function createBatch(status: IStatus; transaction: ITransaction; stmtLength: Cardinal; sqlStmt: PAnsiChar; dialect: Cardinal; inMetadata: IMessageMetadata; parLength: Cardinal; par: BytePtr): IBatch; function createReplicator(status: IStatus): IReplicator; + procedure detach(status: IStatus); + procedure dropDatabase(status: IStatus); end; IAttachmentImpl = class(IAttachment) @@ -1738,28 +1789,32 @@ type function queEvents(status: IStatus; callback: IEventCallback; length: Cardinal; events: BytePtr): IEvents; virtual; abstract; procedure cancelOperation(status: IStatus; option: Integer); virtual; abstract; procedure ping(status: IStatus); virtual; abstract; - procedure detach(status: IStatus); virtual; abstract; - procedure dropDatabase(status: IStatus); virtual; abstract; + procedure detach_1(status: IStatus); virtual; abstract; + procedure dropDatabase_1(status: IStatus); virtual; abstract; function getIdleTimeout(status: IStatus): Cardinal; virtual; abstract; procedure setIdleTimeout(status: IStatus; timeOut: Cardinal); virtual; abstract; function getStatementTimeout(status: IStatus): Cardinal; virtual; abstract; procedure setStatementTimeout(status: IStatus; timeOut: Cardinal); virtual; abstract; function createBatch(status: IStatus; transaction: ITransaction; stmtLength: Cardinal; sqlStmt: PAnsiChar; dialect: Cardinal; inMetadata: IMessageMetadata; parLength: Cardinal; par: BytePtr): IBatch; virtual; abstract; function createReplicator(status: IStatus): IReplicator; virtual; abstract; + procedure detach(status: IStatus); virtual; abstract; + procedure dropDatabase(status: IStatus); virtual; abstract; end; ServiceVTable = class(ReferenceCountedVTable) - detach: IService_detachPtr; + detach_1: IService_detach_1Ptr; query: IService_queryPtr; start: IService_startPtr; + detach: IService_detachPtr; end; IService = class(IReferenceCounted) - const VERSION = 3; + const VERSION = 4; - procedure detach(status: IStatus); + procedure detach_1(status: IStatus); procedure query(status: IStatus; sendLength: Cardinal; sendItems: BytePtr; receiveLength: Cardinal; receiveItems: BytePtr; bufferLength: Cardinal; buffer: BytePtr); procedure start(status: IStatus; spbLength: Cardinal; spb: BytePtr); + procedure detach(status: IStatus); end; IServiceImpl = class(IService) @@ -1767,9 +1822,10 @@ type procedure addRef(); virtual; abstract; function release(): Integer; virtual; abstract; - procedure detach(status: IStatus); virtual; abstract; + procedure detach_1(status: IStatus); virtual; abstract; procedure query(status: IStatus; sendLength: Cardinal; sendItems: BytePtr; receiveLength: Cardinal; receiveItems: BytePtr; bufferLength: Cardinal; buffer: BytePtr); virtual; abstract; procedure start(status: IStatus; spbLength: Cardinal; spb: BytePtr); virtual; abstract; + procedure detach(status: IStatus); virtual; abstract; end; ProviderVTable = class(PluginBaseVTable) @@ -5953,6 +6009,24 @@ begin FbException.checkException(status); end; +procedure IBlob.cancel_1(status: IStatus); +begin + BlobVTable(vTable).cancel_1(Self, status); + FbException.checkException(status); +end; + +procedure IBlob.close_1(status: IStatus); +begin + BlobVTable(vTable).close_1(Self, status); + FbException.checkException(status); +end; + +function IBlob.seek(status: IStatus; mode: Integer; offset: Integer): Integer; +begin + Result := BlobVTable(vTable).seek(Self, status, mode, offset); + FbException.checkException(status); +end; + procedure IBlob.cancel(status: IStatus); begin BlobVTable(vTable).cancel(Self, status); @@ -5965,12 +6039,6 @@ begin FbException.checkException(status); end; -function IBlob.seek(status: IStatus; mode: Integer; offset: Integer): Integer; -begin - Result := BlobVTable(vTable).seek(Self, status, mode, offset); - FbException.checkException(status); -end; - procedure ITransaction.getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); begin TransactionVTable(vTable).getInfo(Self, status, itemsLength, items, bufferLength, buffer); @@ -5983,9 +6051,9 @@ begin FbException.checkException(status); end; -procedure ITransaction.commit(status: IStatus); +procedure ITransaction.commit_1(status: IStatus); begin - TransactionVTable(vTable).commit(Self, status); + TransactionVTable(vTable).commit_1(Self, status); FbException.checkException(status); end; @@ -5995,9 +6063,9 @@ begin FbException.checkException(status); end; -procedure ITransaction.rollback(status: IStatus); +procedure ITransaction.rollback_1(status: IStatus); begin - TransactionVTable(vTable).rollback(Self, status); + TransactionVTable(vTable).rollback_1(Self, status); FbException.checkException(status); end; @@ -6007,9 +6075,9 @@ begin FbException.checkException(status); end; -procedure ITransaction.disconnect(status: IStatus); +procedure ITransaction.disconnect_1(status: IStatus); begin - TransactionVTable(vTable).disconnect(Self, status); + TransactionVTable(vTable).disconnect_1(Self, status); FbException.checkException(status); end; @@ -6031,6 +6099,24 @@ begin FbException.checkException(status); end; +procedure ITransaction.commit(status: IStatus); +begin + TransactionVTable(vTable).commit(Self, status); + FbException.checkException(status); +end; + +procedure ITransaction.rollback(status: IStatus); +begin + TransactionVTable(vTable).rollback(Self, status); + FbException.checkException(status); +end; + +procedure ITransaction.disconnect(status: IStatus); +begin + TransactionVTable(vTable).disconnect(Self, status); + FbException.checkException(status); +end; + function IMessageMetadata.getCount(status: IStatus): Cardinal; begin Result := MessageMetadataVTable(vTable).getCount(Self, status); @@ -6271,9 +6357,9 @@ begin FbException.checkException(status); end; -procedure IResultSet.close(status: IStatus); +procedure IResultSet.close_1(status: IStatus); begin - ResultSetVTable(vTable).close(Self, status); + ResultSetVTable(vTable).close_1(Self, status); FbException.checkException(status); end; @@ -6283,6 +6369,12 @@ begin FbException.checkException(status); end; +procedure IResultSet.close(status: IStatus); +begin + ResultSetVTable(vTable).close(Self, status); + FbException.checkException(status); +end; + procedure IStatement.getInfo(status: IStatus; itemsLength: Cardinal; items: BytePtr; bufferLength: Cardinal; buffer: BytePtr); begin StatementVTable(vTable).getInfo(Self, status, itemsLength, items, bufferLength, buffer); @@ -6337,9 +6429,9 @@ begin FbException.checkException(status); end; -procedure IStatement.free(status: IStatus); +procedure IStatement.free_1(status: IStatus); begin - StatementVTable(vTable).free(Self, status); + StatementVTable(vTable).free_1(Self, status); FbException.checkException(status); end; @@ -6367,6 +6459,12 @@ begin FbException.checkException(status); end; +procedure IStatement.free(status: IStatus); +begin + StatementVTable(vTable).free(Self, status); + FbException.checkException(status); +end; + procedure IBatch.add(status: IStatus; count: Cardinal; inBuffer: Pointer); begin BatchVTable(vTable).add(Self, status, count, inBuffer); @@ -6427,6 +6525,12 @@ begin FbException.checkException(status); end; +procedure IBatch.close_1(status: IStatus); +begin + BatchVTable(vTable).close_1(Self, status); + FbException.checkException(status); +end; + procedure IBatch.close(status: IStatus); begin BatchVTable(vTable).close(Self, status); @@ -6463,6 +6567,12 @@ begin FbException.checkException(status); end; +procedure IReplicator.close_1(status: IStatus); +begin + ReplicatorVTable(vTable).close_1(Self, status); + FbException.checkException(status); +end; + procedure IReplicator.close(status: IStatus); begin ReplicatorVTable(vTable).close(Self, status); @@ -6505,12 +6615,24 @@ begin FbException.checkException(status); end; +procedure IRequest.free_1(status: IStatus); +begin + RequestVTable(vTable).free_1(Self, status); + FbException.checkException(status); +end; + procedure IRequest.free(status: IStatus); begin RequestVTable(vTable).free(Self, status); FbException.checkException(status); end; +procedure IEvents.cancel_1(status: IStatus); +begin + EventsVTable(vTable).cancel_1(Self, status); + FbException.checkException(status); +end; + procedure IEvents.cancel(status: IStatus); begin EventsVTable(vTable).cancel(Self, status); @@ -6613,15 +6735,15 @@ begin FbException.checkException(status); end; -procedure IAttachment.detach(status: IStatus); +procedure IAttachment.detach_1(status: IStatus); begin - AttachmentVTable(vTable).detach(Self, status); + AttachmentVTable(vTable).detach_1(Self, status); FbException.checkException(status); end; -procedure IAttachment.dropDatabase(status: IStatus); +procedure IAttachment.dropDatabase_1(status: IStatus); begin - AttachmentVTable(vTable).dropDatabase(Self, status); + AttachmentVTable(vTable).dropDatabase_1(Self, status); FbException.checkException(status); end; @@ -6661,9 +6783,21 @@ begin FbException.checkException(status); end; -procedure IService.detach(status: IStatus); +procedure IAttachment.detach(status: IStatus); begin - ServiceVTable(vTable).detach(Self, status); + AttachmentVTable(vTable).detach(Self, status); + FbException.checkException(status); +end; + +procedure IAttachment.dropDatabase(status: IStatus); +begin + AttachmentVTable(vTable).dropDatabase(Self, status); + FbException.checkException(status); +end; + +procedure IService.detach_1(status: IStatus); +begin + ServiceVTable(vTable).detach_1(Self, status); FbException.checkException(status); end; @@ -6679,6 +6813,12 @@ begin FbException.checkException(status); end; +procedure IService.detach(status: IStatus); +begin + ServiceVTable(vTable).detach(Self, status); + FbException.checkException(status); +end; + function IProvider.attachDatabase(status: IStatus; fileName: PAnsiChar; dpbLength: Cardinal; dpb: BytePtr): IAttachment; begin Result := ProviderVTable(vTable).attachDatabase(Self, status, fileName, dpbLength, dpb); @@ -9253,6 +9393,33 @@ begin end end; +procedure IBlobImpl_cancel_1Dispatcher(this: IBlob; status: IStatus); cdecl; +begin + try + IBlobImpl(this).cancel_1(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + +procedure IBlobImpl_close_1Dispatcher(this: IBlob; status: IStatus); cdecl; +begin + try + IBlobImpl(this).close_1(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + +function IBlobImpl_seekDispatcher(this: IBlob; status: IStatus; mode: Integer; offset: Integer): Integer; cdecl; +begin + try + Result := IBlobImpl(this).seek(status, mode, offset); + except + on e: Exception do FbException.catchException(status, e); + end +end; + procedure IBlobImpl_cancelDispatcher(this: IBlob; status: IStatus); cdecl; begin try @@ -9271,15 +9438,6 @@ begin end end; -function IBlobImpl_seekDispatcher(this: IBlob; status: IStatus; mode: Integer; offset: Integer): Integer; cdecl; -begin - try - Result := IBlobImpl(this).seek(status, mode, offset); - except - on e: Exception do FbException.catchException(status, e); - end -end; - var IBlobImpl_vTable: BlobVTable; @@ -9324,10 +9482,10 @@ begin end end; -procedure ITransactionImpl_commitDispatcher(this: ITransaction; status: IStatus); cdecl; +procedure ITransactionImpl_commit_1Dispatcher(this: ITransaction; status: IStatus); cdecl; begin try - ITransactionImpl(this).commit(status); + ITransactionImpl(this).commit_1(status); except on e: Exception do FbException.catchException(status, e); end @@ -9342,10 +9500,10 @@ begin end end; -procedure ITransactionImpl_rollbackDispatcher(this: ITransaction; status: IStatus); cdecl; +procedure ITransactionImpl_rollback_1Dispatcher(this: ITransaction; status: IStatus); cdecl; begin try - ITransactionImpl(this).rollback(status); + ITransactionImpl(this).rollback_1(status); except on e: Exception do FbException.catchException(status, e); end @@ -9360,10 +9518,10 @@ begin end end; -procedure ITransactionImpl_disconnectDispatcher(this: ITransaction; status: IStatus); cdecl; +procedure ITransactionImpl_disconnect_1Dispatcher(this: ITransaction; status: IStatus); cdecl; begin try - ITransactionImpl(this).disconnect(status); + ITransactionImpl(this).disconnect_1(status); except on e: Exception do FbException.catchException(status, e); end @@ -9396,6 +9554,33 @@ begin end end; +procedure ITransactionImpl_commitDispatcher(this: ITransaction; status: IStatus); cdecl; +begin + try + ITransactionImpl(this).commit(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + +procedure ITransactionImpl_rollbackDispatcher(this: ITransaction; status: IStatus); cdecl; +begin + try + ITransactionImpl(this).rollback(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + +procedure ITransactionImpl_disconnectDispatcher(this: ITransaction; status: IStatus); cdecl; +begin + try + ITransactionImpl(this).disconnect(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + var ITransactionImpl_vTable: TransactionVTable; @@ -9834,10 +10019,10 @@ begin end end; -procedure IResultSetImpl_closeDispatcher(this: IResultSet; status: IStatus); cdecl; +procedure IResultSetImpl_close_1Dispatcher(this: IResultSet; status: IStatus); cdecl; begin try - IResultSetImpl(this).close(status); + IResultSetImpl(this).close_1(status); except on e: Exception do FbException.catchException(status, e); end @@ -9852,6 +10037,15 @@ begin end end; +procedure IResultSetImpl_closeDispatcher(this: IResultSet; status: IStatus); cdecl; +begin + try + IResultSetImpl(this).close(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + var IResultSetImpl_vTable: ResultSetVTable; @@ -9959,10 +10153,10 @@ begin end end; -procedure IStatementImpl_freeDispatcher(this: IStatement; status: IStatus); cdecl; +procedure IStatementImpl_free_1Dispatcher(this: IStatement; status: IStatus); cdecl; begin try - IStatementImpl(this).free(status); + IStatementImpl(this).free_1(status); except on e: Exception do FbException.catchException(status, e); end @@ -10004,6 +10198,15 @@ begin end end; +procedure IStatementImpl_freeDispatcher(this: IStatement; status: IStatus); cdecl; +begin + try + IStatementImpl(this).free(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + var IStatementImpl_vTable: StatementVTable; @@ -10120,6 +10323,15 @@ begin end end; +procedure IBatchImpl_close_1Dispatcher(this: IBatch; status: IStatus); cdecl; +begin + try + IBatchImpl(this).close_1(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + procedure IBatchImpl_closeDispatcher(this: IBatch; status: IStatus); cdecl; begin try @@ -10217,6 +10429,15 @@ begin end end; +procedure IReplicatorImpl_close_1Dispatcher(this: IReplicator; status: IStatus); cdecl; +begin + try + IReplicatorImpl(this).close_1(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + procedure IReplicatorImpl_closeDispatcher(this: IReplicator; status: IStatus); cdecl; begin try @@ -10306,6 +10527,15 @@ begin end end; +procedure IRequestImpl_free_1Dispatcher(this: IRequest; status: IStatus); cdecl; +begin + try + IRequestImpl(this).free_1(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + procedure IRequestImpl_freeDispatcher(this: IRequest; status: IStatus); cdecl; begin try @@ -10341,6 +10571,15 @@ begin end end; +procedure IEventsImpl_cancel_1Dispatcher(this: IEvents; status: IStatus); cdecl; +begin + try + IEventsImpl(this).cancel_1(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + procedure IEventsImpl_cancelDispatcher(this: IEvents; status: IStatus); cdecl; begin try @@ -10520,19 +10759,19 @@ begin end end; -procedure IAttachmentImpl_detachDispatcher(this: IAttachment; status: IStatus); cdecl; +procedure IAttachmentImpl_detach_1Dispatcher(this: IAttachment; status: IStatus); cdecl; begin try - IAttachmentImpl(this).detach(status); + IAttachmentImpl(this).detach_1(status); except on e: Exception do FbException.catchException(status, e); end end; -procedure IAttachmentImpl_dropDatabaseDispatcher(this: IAttachment; status: IStatus); cdecl; +procedure IAttachmentImpl_dropDatabase_1Dispatcher(this: IAttachment; status: IStatus); cdecl; begin try - IAttachmentImpl(this).dropDatabase(status); + IAttachmentImpl(this).dropDatabase_1(status); except on e: Exception do FbException.catchException(status, e); end @@ -10592,6 +10831,24 @@ begin end end; +procedure IAttachmentImpl_detachDispatcher(this: IAttachment; status: IStatus); cdecl; +begin + try + IAttachmentImpl(this).detach(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + +procedure IAttachmentImpl_dropDatabaseDispatcher(this: IAttachment; status: IStatus); cdecl; +begin + try + IAttachmentImpl(this).dropDatabase(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + var IAttachmentImpl_vTable: AttachmentVTable; @@ -10618,10 +10875,10 @@ begin end end; -procedure IServiceImpl_detachDispatcher(this: IService; status: IStatus); cdecl; +procedure IServiceImpl_detach_1Dispatcher(this: IService; status: IStatus); cdecl; begin try - IServiceImpl(this).detach(status); + IServiceImpl(this).detach_1(status); except on e: Exception do FbException.catchException(status, e); end @@ -10645,6 +10902,15 @@ begin end end; +procedure IServiceImpl_detachDispatcher(this: IService; status: IStatus); cdecl; +begin + try + IServiceImpl(this).detach(status); + except + on e: Exception do FbException.catchException(status, e); + end +end; + var IServiceImpl_vTable: ServiceVTable; @@ -14863,30 +15129,35 @@ initialization IEventCallbackImpl_vTable.eventCallbackFunction := @IEventCallbackImpl_eventCallbackFunctionDispatcher; IBlobImpl_vTable := BlobVTable.create; - IBlobImpl_vTable.version := 3; + IBlobImpl_vTable.version := 4; IBlobImpl_vTable.addRef := @IBlobImpl_addRefDispatcher; IBlobImpl_vTable.release := @IBlobImpl_releaseDispatcher; IBlobImpl_vTable.getInfo := @IBlobImpl_getInfoDispatcher; IBlobImpl_vTable.getSegment := @IBlobImpl_getSegmentDispatcher; IBlobImpl_vTable.putSegment := @IBlobImpl_putSegmentDispatcher; + IBlobImpl_vTable.cancel_1 := @IBlobImpl_cancel_1Dispatcher; + IBlobImpl_vTable.close_1 := @IBlobImpl_close_1Dispatcher; + IBlobImpl_vTable.seek := @IBlobImpl_seekDispatcher; IBlobImpl_vTable.cancel := @IBlobImpl_cancelDispatcher; IBlobImpl_vTable.close := @IBlobImpl_closeDispatcher; - IBlobImpl_vTable.seek := @IBlobImpl_seekDispatcher; ITransactionImpl_vTable := TransactionVTable.create; - ITransactionImpl_vTable.version := 3; + ITransactionImpl_vTable.version := 4; ITransactionImpl_vTable.addRef := @ITransactionImpl_addRefDispatcher; ITransactionImpl_vTable.release := @ITransactionImpl_releaseDispatcher; ITransactionImpl_vTable.getInfo := @ITransactionImpl_getInfoDispatcher; ITransactionImpl_vTable.prepare := @ITransactionImpl_prepareDispatcher; - ITransactionImpl_vTable.commit := @ITransactionImpl_commitDispatcher; + ITransactionImpl_vTable.commit_1 := @ITransactionImpl_commit_1Dispatcher; ITransactionImpl_vTable.commitRetaining := @ITransactionImpl_commitRetainingDispatcher; - ITransactionImpl_vTable.rollback := @ITransactionImpl_rollbackDispatcher; + ITransactionImpl_vTable.rollback_1 := @ITransactionImpl_rollback_1Dispatcher; ITransactionImpl_vTable.rollbackRetaining := @ITransactionImpl_rollbackRetainingDispatcher; - ITransactionImpl_vTable.disconnect := @ITransactionImpl_disconnectDispatcher; + ITransactionImpl_vTable.disconnect_1 := @ITransactionImpl_disconnect_1Dispatcher; ITransactionImpl_vTable.join := @ITransactionImpl_joinDispatcher; ITransactionImpl_vTable.validate := @ITransactionImpl_validateDispatcher; ITransactionImpl_vTable.enterDtc := @ITransactionImpl_enterDtcDispatcher; + ITransactionImpl_vTable.commit := @ITransactionImpl_commitDispatcher; + ITransactionImpl_vTable.rollback := @ITransactionImpl_rollbackDispatcher; + ITransactionImpl_vTable.disconnect := @ITransactionImpl_disconnectDispatcher; IMessageMetadataImpl_vTable := MessageMetadataVTable.create; IMessageMetadataImpl_vTable.version := 4; @@ -14930,7 +15201,7 @@ initialization IMetadataBuilderImpl_vTable.setAlias := @IMetadataBuilderImpl_setAliasDispatcher; IResultSetImpl_vTable := ResultSetVTable.create; - IResultSetImpl_vTable.version := 3; + IResultSetImpl_vTable.version := 4; IResultSetImpl_vTable.addRef := @IResultSetImpl_addRefDispatcher; IResultSetImpl_vTable.release := @IResultSetImpl_releaseDispatcher; IResultSetImpl_vTable.fetchNext := @IResultSetImpl_fetchNextDispatcher; @@ -14942,11 +15213,12 @@ initialization IResultSetImpl_vTable.isEof := @IResultSetImpl_isEofDispatcher; IResultSetImpl_vTable.isBof := @IResultSetImpl_isBofDispatcher; IResultSetImpl_vTable.getMetadata := @IResultSetImpl_getMetadataDispatcher; - IResultSetImpl_vTable.close := @IResultSetImpl_closeDispatcher; + IResultSetImpl_vTable.close_1 := @IResultSetImpl_close_1Dispatcher; IResultSetImpl_vTable.setDelayedOutputFormat := @IResultSetImpl_setDelayedOutputFormatDispatcher; + IResultSetImpl_vTable.close := @IResultSetImpl_closeDispatcher; IStatementImpl_vTable := StatementVTable.create; - IStatementImpl_vTable.version := 4; + IStatementImpl_vTable.version := 5; IStatementImpl_vTable.addRef := @IStatementImpl_addRefDispatcher; IStatementImpl_vTable.release := @IStatementImpl_releaseDispatcher; IStatementImpl_vTable.getInfo := @IStatementImpl_getInfoDispatcher; @@ -14958,14 +15230,15 @@ initialization IStatementImpl_vTable.execute := @IStatementImpl_executeDispatcher; IStatementImpl_vTable.openCursor := @IStatementImpl_openCursorDispatcher; IStatementImpl_vTable.setCursorName := @IStatementImpl_setCursorNameDispatcher; - IStatementImpl_vTable.free := @IStatementImpl_freeDispatcher; + IStatementImpl_vTable.free_1 := @IStatementImpl_free_1Dispatcher; IStatementImpl_vTable.getFlags := @IStatementImpl_getFlagsDispatcher; IStatementImpl_vTable.getTimeout := @IStatementImpl_getTimeoutDispatcher; IStatementImpl_vTable.setTimeout := @IStatementImpl_setTimeoutDispatcher; IStatementImpl_vTable.createBatch := @IStatementImpl_createBatchDispatcher; + IStatementImpl_vTable.free := @IStatementImpl_freeDispatcher; IBatchImpl_vTable := BatchVTable.create; - IBatchImpl_vTable.version := 3; + IBatchImpl_vTable.version := 4; IBatchImpl_vTable.addRef := @IBatchImpl_addRefDispatcher; IBatchImpl_vTable.release := @IBatchImpl_releaseDispatcher; IBatchImpl_vTable.add := @IBatchImpl_addDispatcher; @@ -14978,6 +15251,7 @@ initialization IBatchImpl_vTable.getBlobAlignment := @IBatchImpl_getBlobAlignmentDispatcher; IBatchImpl_vTable.getMetadata := @IBatchImpl_getMetadataDispatcher; IBatchImpl_vTable.setDefaultBpb := @IBatchImpl_setDefaultBpbDispatcher; + IBatchImpl_vTable.close_1 := @IBatchImpl_close_1Dispatcher; IBatchImpl_vTable.close := @IBatchImpl_closeDispatcher; IBatchCompletionStateImpl_vTable := BatchCompletionStateVTable.create; @@ -14989,14 +15263,15 @@ initialization IBatchCompletionStateImpl_vTable.getStatus := @IBatchCompletionStateImpl_getStatusDispatcher; IReplicatorImpl_vTable := ReplicatorVTable.create; - IReplicatorImpl_vTable.version := 3; + IReplicatorImpl_vTable.version := 4; IReplicatorImpl_vTable.addRef := @IReplicatorImpl_addRefDispatcher; IReplicatorImpl_vTable.release := @IReplicatorImpl_releaseDispatcher; IReplicatorImpl_vTable.process := @IReplicatorImpl_processDispatcher; + IReplicatorImpl_vTable.close_1 := @IReplicatorImpl_close_1Dispatcher; IReplicatorImpl_vTable.close := @IReplicatorImpl_closeDispatcher; IRequestImpl_vTable := RequestVTable.create; - IRequestImpl_vTable.version := 3; + IRequestImpl_vTable.version := 4; IRequestImpl_vTable.addRef := @IRequestImpl_addRefDispatcher; IRequestImpl_vTable.release := @IRequestImpl_releaseDispatcher; IRequestImpl_vTable.receive := @IRequestImpl_receiveDispatcher; @@ -15005,16 +15280,18 @@ initialization IRequestImpl_vTable.start := @IRequestImpl_startDispatcher; IRequestImpl_vTable.startAndSend := @IRequestImpl_startAndSendDispatcher; IRequestImpl_vTable.unwind := @IRequestImpl_unwindDispatcher; + IRequestImpl_vTable.free_1 := @IRequestImpl_free_1Dispatcher; IRequestImpl_vTable.free := @IRequestImpl_freeDispatcher; IEventsImpl_vTable := EventsVTable.create; - IEventsImpl_vTable.version := 3; + IEventsImpl_vTable.version := 4; IEventsImpl_vTable.addRef := @IEventsImpl_addRefDispatcher; IEventsImpl_vTable.release := @IEventsImpl_releaseDispatcher; + IEventsImpl_vTable.cancel_1 := @IEventsImpl_cancel_1Dispatcher; IEventsImpl_vTable.cancel := @IEventsImpl_cancelDispatcher; IAttachmentImpl_vTable := AttachmentVTable.create; - IAttachmentImpl_vTable.version := 4; + IAttachmentImpl_vTable.version := 5; IAttachmentImpl_vTable.addRef := @IAttachmentImpl_addRefDispatcher; IAttachmentImpl_vTable.release := @IAttachmentImpl_releaseDispatcher; IAttachmentImpl_vTable.getInfo := @IAttachmentImpl_getInfoDispatcher; @@ -15033,22 +15310,25 @@ initialization IAttachmentImpl_vTable.queEvents := @IAttachmentImpl_queEventsDispatcher; IAttachmentImpl_vTable.cancelOperation := @IAttachmentImpl_cancelOperationDispatcher; IAttachmentImpl_vTable.ping := @IAttachmentImpl_pingDispatcher; - IAttachmentImpl_vTable.detach := @IAttachmentImpl_detachDispatcher; - IAttachmentImpl_vTable.dropDatabase := @IAttachmentImpl_dropDatabaseDispatcher; + IAttachmentImpl_vTable.detach_1 := @IAttachmentImpl_detach_1Dispatcher; + IAttachmentImpl_vTable.dropDatabase_1 := @IAttachmentImpl_dropDatabase_1Dispatcher; IAttachmentImpl_vTable.getIdleTimeout := @IAttachmentImpl_getIdleTimeoutDispatcher; IAttachmentImpl_vTable.setIdleTimeout := @IAttachmentImpl_setIdleTimeoutDispatcher; IAttachmentImpl_vTable.getStatementTimeout := @IAttachmentImpl_getStatementTimeoutDispatcher; IAttachmentImpl_vTable.setStatementTimeout := @IAttachmentImpl_setStatementTimeoutDispatcher; IAttachmentImpl_vTable.createBatch := @IAttachmentImpl_createBatchDispatcher; IAttachmentImpl_vTable.createReplicator := @IAttachmentImpl_createReplicatorDispatcher; + IAttachmentImpl_vTable.detach := @IAttachmentImpl_detachDispatcher; + IAttachmentImpl_vTable.dropDatabase := @IAttachmentImpl_dropDatabaseDispatcher; IServiceImpl_vTable := ServiceVTable.create; - IServiceImpl_vTable.version := 3; + IServiceImpl_vTable.version := 4; IServiceImpl_vTable.addRef := @IServiceImpl_addRefDispatcher; IServiceImpl_vTable.release := @IServiceImpl_releaseDispatcher; - IServiceImpl_vTable.detach := @IServiceImpl_detachDispatcher; + IServiceImpl_vTable.detach_1 := @IServiceImpl_detach_1Dispatcher; IServiceImpl_vTable.query := @IServiceImpl_queryDispatcher; IServiceImpl_vTable.start := @IServiceImpl_startDispatcher; + IServiceImpl_vTable.detach := @IServiceImpl_detachDispatcher; IProviderImpl_vTable := ProviderVTable.create; IProviderImpl_vTable.version := 4; diff --git a/src/jrd/EngineInterface.h b/src/jrd/EngineInterface.h index 72c8f52dea..f53bbbce00 100644 --- a/src/jrd/EngineInterface.h +++ b/src/jrd/EngineInterface.h @@ -63,6 +63,8 @@ public: void cancel(Firebird::CheckStatusWrapper* status) override; void close(Firebird::CheckStatusWrapper* status) override; int seek(Firebird::CheckStatusWrapper* status, int mode, int offset) override; // returns position + void cancel_1(Firebird::CheckStatusWrapper* status) override; + void close_1(Firebird::CheckStatusWrapper* status) override; public: JBlob(blb* handle, StableAttachmentPart* sa); @@ -108,6 +110,9 @@ public: Firebird::ITransaction* join(Firebird::CheckStatusWrapper* status, Firebird::ITransaction* transaction) override; JTransaction* validate(Firebird::CheckStatusWrapper* status, Firebird::IAttachment* testAtt) override; JTransaction* enterDtc(Firebird::CheckStatusWrapper* status) override; + void commit_1(Firebird::CheckStatusWrapper* status) override; + void rollback_1(Firebird::CheckStatusWrapper* status) override; + void disconnect_1(Firebird::CheckStatusWrapper* status) override; public: JTransaction(jrd_tra* handle, StableAttachmentPart* sa); @@ -158,6 +163,7 @@ public: FB_BOOLEAN isBof(Firebird::CheckStatusWrapper* status) override; Firebird::IMessageMetadata* getMetadata(Firebird::CheckStatusWrapper* status) override; void close(Firebird::CheckStatusWrapper* status) override; + void close_1(Firebird::CheckStatusWrapper* status) override; void setDelayedOutputFormat(Firebird::CheckStatusWrapper* status, Firebird::IMessageMetadata* format) override; public: @@ -202,6 +208,7 @@ public: Firebird::IMessageMetadata* getMetadata(Firebird::CheckStatusWrapper* status) override; void setDefaultBpb(Firebird::CheckStatusWrapper* status, unsigned parLength, const unsigned char* par) override; void close(Firebird::CheckStatusWrapper* status) override; + void close_1(Firebird::CheckStatusWrapper* status) override; public: JBatch(DsqlBatch* handle, JStatement* aStatement, Firebird::IMessageMetadata* aMetadata); @@ -234,6 +241,7 @@ public: int release() override; void process(Firebird::CheckStatusWrapper* status, unsigned length, const unsigned char* data) override; void close(Firebird::CheckStatusWrapper* status) override; + void close_1(Firebird::CheckStatusWrapper* status) override; public: JReplicator(Applier* appl, StableAttachmentPart* sa); @@ -270,6 +278,7 @@ public: unsigned int itemsLength, const unsigned char* items, unsigned int bufferLength, unsigned char* buffer) override; void free(Firebird::CheckStatusWrapper* status) override; + void free_1(Firebird::CheckStatusWrapper* status) override; ISC_UINT64 getAffectedRecords(Firebird::CheckStatusWrapper* userStatus) override; Firebird::IMessageMetadata* getOutputMetadata(Firebird::CheckStatusWrapper* userStatus) override; Firebird::IMessageMetadata* getInputMetadata(Firebird::CheckStatusWrapper* userStatus) override; @@ -328,6 +337,7 @@ public: unsigned int msg_type, unsigned int length, const void* message) override; void unwind(Firebird::CheckStatusWrapper* status, int level) override; void free(Firebird::CheckStatusWrapper* status) override; + void free_1(Firebird::CheckStatusWrapper* status) override; public: JRequest(JrdStatement* handle, StableAttachmentPart* sa); @@ -355,6 +365,7 @@ public: // IEvents implementation int release() override; void cancel(Firebird::CheckStatusWrapper* status) override; + void cancel_1(Firebird::CheckStatusWrapper* status) override; public: JEvents(int aId, StableAttachmentPart* sa, Firebird::IEventCallback* aCallback); @@ -428,6 +439,8 @@ public: void ping(Firebird::CheckStatusWrapper* status) override; void detach(Firebird::CheckStatusWrapper* status) override; void dropDatabase(Firebird::CheckStatusWrapper* status) override; + void detach_1(Firebird::CheckStatusWrapper* status) override; + void dropDatabase_1(Firebird::CheckStatusWrapper* status) override; unsigned int getIdleTimeout(Firebird::CheckStatusWrapper* status) override; void setIdleTimeout(Firebird::CheckStatusWrapper* status, unsigned int timeOut) override; @@ -477,6 +490,7 @@ public: // IService implementation int release() override; void detach(Firebird::CheckStatusWrapper* status) override; + void detach_1(Firebird::CheckStatusWrapper* status) override; void query(Firebird::CheckStatusWrapper* status, unsigned int sendLength, const unsigned char* sendItems, unsigned int receiveLength, const unsigned char* receiveItems, diff --git a/src/jrd/jrd.cpp b/src/jrd/jrd.cpp index 3859fdad7e..71719b72f6 100644 --- a/src/jrd/jrd.cpp +++ b/src/jrd/jrd.cpp @@ -2315,7 +2315,7 @@ void JBlob::getInfo(CheckStatusWrapper* user_status, } -void JBlob::cancel(CheckStatusWrapper* user_status) +void JBlob::cancel_1(CheckStatusWrapper* user_status) { /************************************** * @@ -2331,6 +2331,14 @@ void JBlob::cancel(CheckStatusWrapper* user_status) } +void JBlob::cancel(CheckStatusWrapper* user_status) +{ + freeEngineData(user_status); + if (user_status->isEmpty()) + release(); +} + + void JBlob::freeEngineData(CheckStatusWrapper* user_status) { /************************************** @@ -2369,7 +2377,7 @@ void JBlob::freeEngineData(CheckStatusWrapper* user_status) } -void JEvents::cancel(CheckStatusWrapper* user_status) +void JEvents::cancel_1(CheckStatusWrapper* user_status) { /************************************** * @@ -2385,6 +2393,14 @@ void JEvents::cancel(CheckStatusWrapper* user_status) } +void JEvents::cancel(CheckStatusWrapper* user_status) +{ + freeEngineData(user_status); + if (user_status->isEmpty()) + release(); +} + + void JEvents::freeEngineData(CheckStatusWrapper* user_status) { /************************************** @@ -2466,6 +2482,14 @@ void JAttachment::cancelOperation(CheckStatusWrapper* user_status, int option) void JBlob::close(CheckStatusWrapper* user_status) +{ + close_1(user_status); + if (user_status->isEmpty()) + release(); +} + + +void JBlob::close_1(CheckStatusWrapper* user_status) { /************************************** * @@ -2505,6 +2529,14 @@ void JBlob::close(CheckStatusWrapper* user_status) void JTransaction::commit(CheckStatusWrapper* user_status) +{ + commit_1(user_status); + if (user_status->isEmpty()) + release(); +} + + +void JTransaction::commit_1(CheckStatusWrapper* user_status) { /************************************** * @@ -3210,7 +3242,7 @@ void JAttachment::executeDyn(CheckStatusWrapper* status, ITransaction* /*tra*/, } -void JAttachment::detach(CheckStatusWrapper* user_status) +void JAttachment::detach_1(CheckStatusWrapper* user_status) { /************************************** * @@ -3229,6 +3261,24 @@ void JAttachment::detach(CheckStatusWrapper* user_status) } +void JAttachment::detach(CheckStatusWrapper* user_status) +{ +/************************************** + * + * g d s _ $ d e t a c h + * + ************************************** + * + * Functional description + * Close down a database. + * + **************************************/ + detach_1(user_status); + if (user_status->isEmpty()) + release(); +} + + void JAttachment::freeEngineData(CheckStatusWrapper* user_status, bool forceFree) { /************************************** @@ -3304,6 +3354,14 @@ void JAttachment::freeEngineData(CheckStatusWrapper* user_status, bool forceFree void JAttachment::dropDatabase(CheckStatusWrapper* user_status) +{ + dropDatabase_1(user_status); + if (user_status->isEmpty()) + release(); +} + + +void JAttachment::dropDatabase_1(CheckStatusWrapper* user_status) { /************************************** * @@ -3876,7 +3934,7 @@ JTransaction* JAttachment::reconnectTransaction(CheckStatusWrapper* user_status, } -void JRequest::free(CheckStatusWrapper* user_status) +void JRequest::free_1(CheckStatusWrapper* user_status) { /************************************** * @@ -3892,6 +3950,14 @@ void JRequest::free(CheckStatusWrapper* user_status) } +void JRequest::free(CheckStatusWrapper* user_status) +{ + freeEngineData(user_status); + if (user_status->isEmpty()) + release(); +} + + void JRequest::freeEngineData(CheckStatusWrapper* user_status) { /************************************** @@ -4008,6 +4074,14 @@ void JTransaction::rollbackRetaining(CheckStatusWrapper* user_status) void JTransaction::rollback(CheckStatusWrapper* user_status) +{ + rollback_1(user_status); + if (user_status->isEmpty()) + release(); +} + + +void JTransaction::rollback_1(CheckStatusWrapper* user_status) { /************************************** * @@ -4046,6 +4120,14 @@ void JTransaction::rollback(CheckStatusWrapper* user_status) void JTransaction::disconnect(CheckStatusWrapper* user_status) +{ + disconnect_1(user_status); + if (user_status->isEmpty()) + release(); +} + + +void JTransaction::disconnect_1(CheckStatusWrapper* user_status) { try { @@ -4180,7 +4262,7 @@ JService* JProvider::attachServiceManager(CheckStatusWrapper* user_status, const } -void JService::detach(CheckStatusWrapper* user_status) +void JService::detach_1(CheckStatusWrapper* user_status) { /************************************** * @@ -4196,6 +4278,14 @@ void JService::detach(CheckStatusWrapper* user_status) } +void JService::detach(CheckStatusWrapper* user_status) +{ + freeEngineData(user_status); + if (user_status->isEmpty()) + release(); +} + + void JService::freeEngineData(CheckStatusWrapper* user_status) { /************************************** @@ -5361,20 +5451,30 @@ void JResultSet::freeEngineData(CheckStatusWrapper* user_status) successful_completion(user_status); } + StableAttachmentPart* JResultSet::getAttachment() { return statement->getAttachment(); } + IMessageMetadata* JResultSet::getMetadata(CheckStatusWrapper* user_status) { return statement->getOutputMetadata(user_status); } +void JResultSet::close_1(CheckStatusWrapper* user_status) +{ + freeEngineData(user_status); +} + + void JResultSet::close(CheckStatusWrapper* user_status) { freeEngineData(user_status); + if (user_status->isEmpty()) + release(); } @@ -5406,9 +5506,17 @@ void JStatement::freeEngineData(CheckStatusWrapper* user_status) } +void JStatement::free_1(CheckStatusWrapper* user_status) +{ + freeEngineData(user_status); +} + + void JStatement::free(CheckStatusWrapper* user_status) { freeEngineData(user_status); + if (user_status->isEmpty()) + release(); } @@ -5890,9 +5998,17 @@ int JBatch::release() } +void JBatch::close_1(CheckStatusWrapper* user_status) +{ + freeEngineData(user_status); +} + + void JBatch::close(CheckStatusWrapper* user_status) { freeEngineData(user_status); + if (user_status->isEmpty()) + release(); } @@ -6296,9 +6412,17 @@ void JReplicator::process(CheckStatusWrapper* status, unsigned length, const UCH } +void JReplicator::close_1(CheckStatusWrapper* user_status) +{ + freeEngineData(user_status); +} + + void JReplicator::close(CheckStatusWrapper* user_status) { freeEngineData(user_status); + if (user_status->isEmpty()) + release(); } diff --git a/src/remote/client/interface.cpp b/src/remote/client/interface.cpp index c1a15d2f28..057af140c9 100644 --- a/src/remote/client/interface.cpp +++ b/src/remote/client/interface.cpp @@ -173,6 +173,8 @@ public: void cancel(CheckStatusWrapper* status) override; void close(CheckStatusWrapper* status) override; int seek(CheckStatusWrapper* status, int mode, int offset) override; // returns position + void cancel_1(Firebird::CheckStatusWrapper* status) override; + void close_1(Firebird::CheckStatusWrapper* status) override; public: explicit Blob(Rbl* handle) @@ -223,6 +225,9 @@ public: ITransaction* join(CheckStatusWrapper* status, ITransaction* tra) override; Transaction* validate(CheckStatusWrapper* status, IAttachment* attachment) override; Transaction* enterDtc(CheckStatusWrapper* status) override; + void commit_1(Firebird::CheckStatusWrapper* status) override; + void rollback_1(Firebird::CheckStatusWrapper* status) override; + void disconnect_1(Firebird::CheckStatusWrapper* status) override; public: Transaction(Rtr* handle, Attachment* a) @@ -285,6 +290,7 @@ public: FB_BOOLEAN isBof(CheckStatusWrapper* status) override; IMessageMetadata* getMetadata(CheckStatusWrapper* status) override; void close(CheckStatusWrapper* status) override; + void close_1(CheckStatusWrapper* status) override; void setDelayedOutputFormat(CheckStatusWrapper* status, IMessageMetadata* format) override; ResultSet(Statement* s, IMessageMetadata* outFmt) @@ -328,7 +334,7 @@ public: Batch(Statement* s, IMessageMetadata* inFmt, unsigned parLength, const unsigned char* par); - // IResultSet implementation + // IBatch implementation int release() override; void add(Firebird::CheckStatusWrapper* status, unsigned count, const void* inBuffer) override; void addBlob(Firebird::CheckStatusWrapper* status, unsigned length, const void* inBuffer, ISC_QUAD* blobId, @@ -342,6 +348,7 @@ public: void setDefaultBpb(Firebird::CheckStatusWrapper* status, unsigned parLength, const unsigned char* par) override; Firebird::IMessageMetadata* getMetadata(Firebird::CheckStatusWrapper* status) override; void close(Firebird::CheckStatusWrapper* status) override; + void close_1(Firebird::CheckStatusWrapper* status) override; private: void freeClientData(CheckStatusWrapper* status, bool force = false); @@ -569,6 +576,7 @@ public: int release() override; void process(CheckStatusWrapper* status, unsigned length, const unsigned char* data) override; void close(CheckStatusWrapper* status) override; + void close_1(CheckStatusWrapper* status) override; explicit Replicator(Attachment* att) : attachment(att) {} @@ -616,6 +624,7 @@ public: unsigned int flags) override; void setCursorName(CheckStatusWrapper* status, const char* name) override; void free(CheckStatusWrapper* status) override; + void free_1(CheckStatusWrapper* status) override; unsigned getFlags(CheckStatusWrapper* status) override; unsigned int getTimeout(CheckStatusWrapper* status) override @@ -716,6 +725,7 @@ public: unsigned int length, const void* message) override; void unwind(CheckStatusWrapper* status, int level) override; void free(CheckStatusWrapper* status) override; + void free_1(CheckStatusWrapper* status) override; public: Request(Rrq* handle, Attachment* a) @@ -753,6 +763,7 @@ public: // IEvents implementation int release() override; void cancel(CheckStatusWrapper* status) override; + void cancel_1(CheckStatusWrapper* status) override; public: Events(Rvnt* handle) @@ -834,6 +845,8 @@ public: void ping(CheckStatusWrapper* status) override; void detach(CheckStatusWrapper* status) override; void dropDatabase(CheckStatusWrapper* status) override; + void detach_1(Firebird::CheckStatusWrapper* status) override; + void dropDatabase_1(Firebird::CheckStatusWrapper* status) override; unsigned int getIdleTimeout(CheckStatusWrapper* status) override; void setIdleTimeout(CheckStatusWrapper* status, unsigned int timeOut) override; @@ -898,6 +911,7 @@ public: // IService implementation int release() override; void detach(CheckStatusWrapper* status) override; + void detach_1(CheckStatusWrapper* status) override; void query(CheckStatusWrapper* status, unsigned int sendLength, const unsigned char* sendItems, unsigned int receiveLength, const unsigned char* receiveItems, @@ -1278,7 +1292,7 @@ void Blob::freeClientData(CheckStatusWrapper* status, bool force) } -void Blob::cancel(CheckStatusWrapper* status) +void Blob::cancel_1(CheckStatusWrapper* status) { /************************************** * @@ -1295,7 +1309,15 @@ void Blob::cancel(CheckStatusWrapper* status) } -void Blob::close(CheckStatusWrapper* status) +void Blob::cancel(CheckStatusWrapper* status) +{ + cancel_1(status); + if (status->isEmpty()) + release(); +} + + +void Blob::close_1(CheckStatusWrapper* status) { /************************************** * @@ -1334,6 +1356,14 @@ void Blob::close(CheckStatusWrapper* status) } +void Blob::close(CheckStatusWrapper* status) +{ + close_1(status); + if (status->isEmpty()) + release(); +} + + void Events::freeClientData(CheckStatusWrapper* status, bool force) { /************************************** @@ -1416,7 +1446,7 @@ void Events::freeClientData(CheckStatusWrapper* status, bool force) } -void Events::cancel(CheckStatusWrapper* status) +void Events::cancel_1(CheckStatusWrapper* status) { /************************************** * @@ -1433,7 +1463,15 @@ void Events::cancel(CheckStatusWrapper* status) } -void Transaction::commit(CheckStatusWrapper* status) +void Events::cancel(CheckStatusWrapper* status) +{ + cancel_1(status); + if (status->isEmpty()) + release(); +} + + +void Transaction::commit_1(CheckStatusWrapper* status) { /************************************** * @@ -1468,6 +1506,14 @@ void Transaction::commit(CheckStatusWrapper* status) } +void Transaction::commit(CheckStatusWrapper* status) +{ + commit_1(status); + if (status->isEmpty()) + release(); +} + + void Transaction::commitRetaining(CheckStatusWrapper* status) { /************************************** @@ -1987,7 +2033,7 @@ void Attachment::freeClientData(CheckStatusWrapper* status, bool force) } -void Attachment::detach(CheckStatusWrapper* status) +void Attachment::detach_1(CheckStatusWrapper* status) { /************************************** * @@ -2004,7 +2050,15 @@ void Attachment::detach(CheckStatusWrapper* status) } -void Attachment::dropDatabase(CheckStatusWrapper* status) +void Attachment::detach(CheckStatusWrapper* status) +{ + detach_1(status); + if (status->isEmpty()) + release(); +} + + +void Attachment::dropDatabase_1(CheckStatusWrapper* status) { /************************************** * @@ -2062,6 +2116,14 @@ void Attachment::dropDatabase(CheckStatusWrapper* status) } +void Attachment::dropDatabase(CheckStatusWrapper* status) +{ + dropDatabase_1(status); + if (status->isEmpty()) + release(); +} + + SLONG Attachment::getSingleInfo(CheckStatusWrapper* status, UCHAR infoItem) { UCHAR buff[16]; @@ -2885,6 +2947,14 @@ void Batch::close(CheckStatusWrapper* status) } +void Batch::close_1(CheckStatusWrapper* status) +{ + close_1(status); + if (status->isEmpty()) + release(); +} + + void Batch::releaseStatement() { if (tmpStatement) @@ -2976,6 +3046,14 @@ void Replicator::close(CheckStatusWrapper* status) } +void Replicator::close_1(CheckStatusWrapper* status) +{ + close_1(status); + if (status->isEmpty()) + release(); +} + + void Replicator::freeClientData(CheckStatusWrapper* status, bool force) { try @@ -3626,7 +3704,7 @@ void Statement::freeClientData(CheckStatusWrapper* status, bool force) } -void Statement::free(CheckStatusWrapper* status) +void Statement::free_1(CheckStatusWrapper* status) { /************************************** * @@ -3644,6 +3722,14 @@ void Statement::free(CheckStatusWrapper* status) } +void Statement::free(CheckStatusWrapper* status) +{ + free_1(status); + if (status->isEmpty()) + release(); +} + + Statement* Attachment::createStatement(CheckStatusWrapper* status, unsigned dialect) { reset(status); @@ -4631,7 +4717,7 @@ void ResultSet::freeClientData(CheckStatusWrapper* status, bool force) } -void ResultSet::close(CheckStatusWrapper* status) +void ResultSet::close_1(CheckStatusWrapper* status) { /************************************** * @@ -4649,6 +4735,25 @@ void ResultSet::close(CheckStatusWrapper* status) } +void ResultSet::close(CheckStatusWrapper* status) +{ +/************************************** + * + * d s q l _ f r e e _ s t a t e m e n t + * + ************************************** + * + * Functional description + * Close SQL cursor + * + **************************************/ + + close_1(status); + if (status->isEmpty()) + release(); +} + + void ResultSet::releaseStatement() { if (tmpStatement) @@ -5532,7 +5637,7 @@ void Request::freeClientData(CheckStatusWrapper* status, bool force) } -void Request::free(CheckStatusWrapper* status) +void Request::free_1(CheckStatusWrapper* status) { /************************************** * @@ -5549,6 +5654,14 @@ void Request::free(CheckStatusWrapper* status) } +void Request::free(CheckStatusWrapper* status) +{ + free_1(status); + if (status->isEmpty()) + release(); +} + + void Request::getInfo(CheckStatusWrapper* status, int level, unsigned int itemsLength, const unsigned char* items, unsigned int bufferLength, unsigned char* buffer) @@ -5716,7 +5829,7 @@ void Transaction::freeClientData(CheckStatusWrapper* status, bool force) } -void Transaction::rollback(CheckStatusWrapper* status) +void Transaction::rollback_1(CheckStatusWrapper* status) { /************************************** * @@ -5733,7 +5846,15 @@ void Transaction::rollback(CheckStatusWrapper* status) } -void Transaction::disconnect(CheckStatusWrapper* status) +void Transaction::rollback(CheckStatusWrapper* status) +{ + rollback_1(status); + if (status->isEmpty()) + release(); +} + + +void Transaction::disconnect_1(CheckStatusWrapper* status) { try { @@ -5753,6 +5874,15 @@ void Transaction::disconnect(CheckStatusWrapper* status) } +void Transaction::disconnect(CheckStatusWrapper* status) +{ + disconnect_1(status); + if (status->isEmpty()) + release(); +} + + + int Blob::seek(CheckStatusWrapper* status, int mode, int offset) { /************************************** @@ -6004,7 +6134,7 @@ void Service::freeClientData(CheckStatusWrapper* status, bool force) } -void Service::detach(CheckStatusWrapper* status) +void Service::detach_1(CheckStatusWrapper* status) { /************************************** * @@ -6021,6 +6151,14 @@ void Service::detach(CheckStatusWrapper* status) } +void Service::detach(CheckStatusWrapper* status) +{ + detach_1(status); + if (status->isEmpty()) + release(); +} + + void Service::query(CheckStatusWrapper* status, unsigned int sendLength, const unsigned char* sendItems, unsigned int receiveLength, const unsigned char* receiveItems, diff --git a/src/yvalve/DistributedTransaction.cpp b/src/yvalve/DistributedTransaction.cpp index 936db41ddb..e6f776824e 100644 --- a/src/yvalve/DistributedTransaction.cpp +++ b/src/yvalve/DistributedTransaction.cpp @@ -61,6 +61,9 @@ public: DTransaction* join(CheckStatusWrapper* status, ITransaction* transaction); ITransaction* validate(CheckStatusWrapper* status, IAttachment* attachment); DTransaction* enterDtc(CheckStatusWrapper* status); + void commit_1(CheckStatusWrapper* status); + void rollback_1(CheckStatusWrapper* status); + void disconnect_1(CheckStatusWrapper* status); private: typedef HalfStaticArray SubArray; @@ -97,7 +100,7 @@ bool DTransaction::buildPrepareInfo(CheckStatusWrapper* status, TdrBuffer& tdr, // limit MAX_SSHORT is chosen cause for old API larger buffer cause problems UCHAR* buf = bigBuffer.getBuffer(MAX_SSHORT); from->getInfo(status, sizeof(PREPARE_TR_INFO), PREPARE_TR_INFO, bigBuffer.getCount(), buf); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) return false; UCHAR* const end = bigBuffer.end(); @@ -178,7 +181,7 @@ void DTransaction::getInfo(CheckStatusWrapper* status, if (sub[i]) { sub[i]->getInfo(status, itemsLength, items, bufferLength, buffer); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) { return; } @@ -232,7 +235,7 @@ void DTransaction::prepare(CheckStatusWrapper* status, { sub[i]->prepare(status, msgLength, message); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) return; } } @@ -252,7 +255,7 @@ void DTransaction::commit(CheckStatusWrapper* status) status->init(); prepare(status, 0, NULL); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) { return; } @@ -265,7 +268,7 @@ void DTransaction::commit(CheckStatusWrapper* status) if (sub[i]) { sub[i]->commit(status); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) return; sub[i] = NULL; @@ -295,12 +298,10 @@ void DTransaction::commitRetaining(CheckStatusWrapper* status) if (sub[i]) { sub[i]->commitRetaining(status); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) return; } } - - limbo = true; // ASF: why do retaining marks limbo? } catch (const Exception& ex) { @@ -322,7 +323,7 @@ void DTransaction::rollback(CheckStatusWrapper* status) if (sub[i]) { sub[i]->rollback(status); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) return; sub[i] = NULL; @@ -349,12 +350,10 @@ void DTransaction::rollbackRetaining(CheckStatusWrapper* status) if (sub[i]) { sub[i]->rollbackRetaining(status); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) return; } } - - limbo = true; // ASF: why do retaining marks limbo? } catch (const Exception& ex) { @@ -378,7 +377,7 @@ void DTransaction::disconnect(CheckStatusWrapper* status) if (sub[i]) { sub[i]->disconnect(status); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) return; sub[i] = NULL; @@ -391,6 +390,22 @@ void DTransaction::disconnect(CheckStatusWrapper* status) } } +void DTransaction::commit_1(CheckStatusWrapper* status) +{ + commit(status); +} + +void DTransaction::rollback_1(CheckStatusWrapper* status) +{ + rollback(status); +} + +void DTransaction::disconnect_1(CheckStatusWrapper* status) +{ + disconnect(status); +} + + // To do: check the maximum allowed dbs in a two phase commit. // Q: what is the maximum? DTransaction* DTransaction::join(CheckStatusWrapper* status, ITransaction* transaction) @@ -528,7 +543,7 @@ YTransaction* DtcStart::start(CheckStatusWrapper* status) RefPtr dtransaction(FB_NEW DTransaction); unsigned cnt = components.getCount(); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) status_exception::raise(status); if (cnt == 0) (Arg::Gds(isc_random) << "No attachments to start distributed transaction provided").raise(); @@ -536,11 +551,11 @@ YTransaction* DtcStart::start(CheckStatusWrapper* status) for (unsigned i = 0; i < cnt; ++i) { ITransaction* started = components[i].att->startTransaction(status, components[i].tpbLen, components[i].tpb); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) status_exception::raise(status); dtransaction->join(status, started); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) { started->release(); status_exception::raise(status); @@ -570,12 +585,12 @@ YTransaction* Dtc::join(CheckStatusWrapper* status, ITransaction* one, ITransact RefPtr dtransaction(FB_NEW DTransaction); dtransaction->join(status, one); - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) return NULL; dtransaction->join(status, two); /* We must not return NULL - first transaction is available only inside dtransaction - if (status->getState() & Firebird::IStatus::STATE_ERRORS) + if (status->getState() & IStatus::STATE_ERRORS) return NULL; */ diff --git a/src/yvalve/YObjects.h b/src/yvalve/YObjects.h index 0a41ea081c..b99b4353cb 100644 --- a/src/yvalve/YObjects.h +++ b/src/yvalve/YObjects.h @@ -133,6 +133,7 @@ public: typedef YAttachment YRef; static const unsigned DF_RELEASE = 0x1; + static const unsigned DF_KEEP_NEXT = 0x2; explicit YHelper(NextInterface* aNext, const char* m = NULL) : @@ -160,7 +161,10 @@ public: void destroy2(unsigned dstrFlags) { - next = NULL; + if (dstrFlags & DF_KEEP_NEXT) + next.clear(); + else + next = NULL; if (dstrFlags & DF_RELEASE) { @@ -213,6 +217,7 @@ public: // IEvents implementation void cancel(Firebird::CheckStatusWrapper* status); + void cancel_1(Firebird::CheckStatusWrapper* status); public: AtomicAttPtr attachment; @@ -245,6 +250,7 @@ public: unsigned int msgType, unsigned int length, const void* message); void unwind(Firebird::CheckStatusWrapper* status, int level); void free(Firebird::CheckStatusWrapper* status); + void free_1(Firebird::CheckStatusWrapper* status); public: AtomicAttPtr attachment; @@ -275,6 +281,9 @@ public: Firebird::ITransaction* join(Firebird::CheckStatusWrapper* status, Firebird::ITransaction* transaction); Firebird::ITransaction* validate(Firebird::CheckStatusWrapper* status, Firebird::IAttachment* testAtt); YTransaction* enterDtc(Firebird::CheckStatusWrapper* status); + void commit_1(Firebird::CheckStatusWrapper* status); + void rollback_1(Firebird::CheckStatusWrapper* status); + void disconnect_1(Firebird::CheckStatusWrapper* status); void addCleanupHandler(Firebird::CheckStatusWrapper* status, CleanupCallback* callback); void selfCheck(); @@ -324,6 +333,8 @@ public: void cancel(Firebird::CheckStatusWrapper* status); void close(Firebird::CheckStatusWrapper* status); int seek(Firebird::CheckStatusWrapper* status, int mode, int offset); + void cancel_1(Firebird::CheckStatusWrapper* status); + void close_1(Firebird::CheckStatusWrapper* status); public: AtomicAttPtr attachment; @@ -353,6 +364,7 @@ public: FB_BOOLEAN isBof(Firebird::CheckStatusWrapper* status); Firebird::IMessageMetadata* getMetadata(Firebird::CheckStatusWrapper* status); void close(Firebird::CheckStatusWrapper* status); + void close_1(Firebird::CheckStatusWrapper* status); void setDelayedOutputFormat(Firebird::CheckStatusWrapper* status, Firebird::IMessageMetadata* format); public: @@ -384,6 +396,7 @@ public: void cancel(Firebird::CheckStatusWrapper* status); void setDefaultBpb(Firebird::CheckStatusWrapper* status, unsigned parLength, const unsigned char* par); void close(Firebird::CheckStatusWrapper* status); + void close_1(Firebird::CheckStatusWrapper* status); public: AtomicAttPtr attachment; @@ -403,6 +416,7 @@ public: // IReplicator implementation void process(Firebird::CheckStatusWrapper* status, unsigned length, const unsigned char* data); void close(Firebird::CheckStatusWrapper* status); + void close_1(Firebird::CheckStatusWrapper* status); public: AtomicAttPtr attachment; @@ -451,6 +465,7 @@ public: unsigned int flags); void setCursorName(Firebird::CheckStatusWrapper* status, const char* name); void free(Firebird::CheckStatusWrapper* status); + void free_1(Firebird::CheckStatusWrapper* status); unsigned getFlags(Firebird::CheckStatusWrapper* status); unsigned int getTimeout(Firebird::CheckStatusWrapper* status); @@ -540,6 +555,8 @@ public: void ping(Firebird::CheckStatusWrapper* status); void detach(Firebird::CheckStatusWrapper* status); void dropDatabase(Firebird::CheckStatusWrapper* status); + void detach_1(Firebird::CheckStatusWrapper* status); + void dropDatabase_1(Firebird::CheckStatusWrapper* status); void addCleanupHandler(Firebird::CheckStatusWrapper* status, CleanupCallback* callback); YTransaction* getTransaction(Firebird::ITransaction* tra); @@ -587,6 +604,7 @@ public: // IService implementation void detach(Firebird::CheckStatusWrapper* status); + void detach_1(Firebird::CheckStatusWrapper* status); void query(Firebird::CheckStatusWrapper* status, unsigned int sendLength, const unsigned char* sendItems, unsigned int receiveLength, const unsigned char* receiveItems, diff --git a/src/yvalve/why.cpp b/src/yvalve/why.cpp index 1bb191e629..01ad0fac40 100644 --- a/src/yvalve/why.cpp +++ b/src/yvalve/why.cpp @@ -75,6 +75,8 @@ #include #endif +#include + using namespace Firebird; using namespace Why; @@ -1324,6 +1326,27 @@ namespace Why bool shutdownMode; }; + + template + void done(CheckStatusWrapper* status, YEntry& entry, Y* y, std::function newClose, std::function oldClose) + { + if (entry.next()) + newClose(); + + if (!(status->getState() & IStatus::STATE_ERRORS)) + y->destroy(Y::DF_RELEASE | Y::DF_KEEP_NEXT); + + else if (status->getErrors()[1] == isc_wish_list) + { + status->init(); + if (entry.next()) + oldClose(); + + if (!(status->getState() & IStatus::STATE_ERRORS)) + y->destroy(Y::DF_RELEASE); + } + } + } // namespace Why struct TEB @@ -3892,14 +3915,11 @@ void YEvents::cancel(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - if (entry.next()) - entry.next()->cancel(status); - - if (status->getErrors()[1] == isc_att_shutdown) - status->init(); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{ + entry.next()->cancel(status); + if (status->getErrors()[1] == isc_att_shutdown) + status->init(); + }, [&]{entry.next()->cancel_1(status);}); } catch (const Exception& e) { @@ -3907,6 +3927,11 @@ void YEvents::cancel(CheckStatusWrapper* status) } } +void YEvents::cancel_1(CheckStatusWrapper* status) +{ + cancel(status); +} + //------------------------------------- @@ -4037,11 +4062,7 @@ void YRequest::free(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - if (entry.next()) - entry.next()->free(status); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{entry.next()->free(status);}, [&]{entry.next()->free_1(status);}); } catch (const Exception& e) { @@ -4049,6 +4070,11 @@ void YRequest::free(CheckStatusWrapper* status) } } +void YRequest::free_1(CheckStatusWrapper* status) +{ + free(status); +} + //------------------------------------- @@ -4132,11 +4158,7 @@ void YBlob::cancel(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - if (entry.next()) - entry.next()->cancel(status); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{entry.next()->cancel(status);}, [&]{entry.next()->cancel_1(status);}); } catch (const Exception& e) { @@ -4144,17 +4166,18 @@ void YBlob::cancel(CheckStatusWrapper* status) } } +void YBlob::cancel_1(CheckStatusWrapper* status) +{ + cancel(status); +} + void YBlob::close(CheckStatusWrapper* status) { try { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - if (entry.next()) - entry.next()->close(status); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->close_1(status);}); } catch (const Exception& e) { @@ -4162,6 +4185,11 @@ void YBlob::close(CheckStatusWrapper* status) } } +void YBlob::close_1(CheckStatusWrapper* status) +{ + close(status); +} + int YBlob::seek(CheckStatusWrapper* status, int mode, int offset) { try @@ -4429,11 +4457,7 @@ void YStatement::free(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - if (entry.next()) - entry.next()->free(status); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{entry.next()->free(status);}, [&]{entry.next()->free_1(status);}); } catch (const Exception& e) { @@ -4441,6 +4465,12 @@ void YStatement::free(CheckStatusWrapper* status) } } +void YStatement::free_1(CheckStatusWrapper* status) +{ + free(status); +} + + YBatch* YStatement::createBatch(CheckStatusWrapper* status, IMessageMetadata* inMetadata, unsigned parLength, const unsigned char* par) { @@ -4838,17 +4868,14 @@ IMessageMetadata* YResultSet::getMetadata(CheckStatusWrapper* status) return NULL; } + void YResultSet::close(CheckStatusWrapper* status) { try { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - if (entry.next()) - entry.next()->close(status); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->close_1(status);}); } catch (const Exception& e) { @@ -4856,6 +4883,12 @@ void YResultSet::close(CheckStatusWrapper* status) } } +void YResultSet::close_1(CheckStatusWrapper* status) +{ + close(status); +} + + //------------------------------------- @@ -5034,11 +5067,7 @@ void YBatch::close(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - if (entry.next()) - entry.next()->close(status); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->close_1(status);}); } catch (const Exception& e) { @@ -5047,6 +5076,12 @@ void YBatch::close(CheckStatusWrapper* status) } +void YBatch::close_1(CheckStatusWrapper* status) +{ + close(status); +} + + //------------------------------------- @@ -5082,11 +5117,7 @@ void YReplicator::close(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - if (entry.next()) - entry.next()->close(status); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{entry.next()->close(status);}, [&]{entry.next()->close_1(status);}); } catch (const Exception& e) { @@ -5095,6 +5126,12 @@ void YReplicator::close(CheckStatusWrapper* status) } +void YReplicator::close_1(CheckStatusWrapper* status) +{ + close(status); +} + + //------------------------------------- @@ -5133,8 +5170,8 @@ void YTransaction::destroy(unsigned dstrFlags) // can't release cursors by itself. See also CORE-6067. const bool releaseCursors = handle; - childBlobs.destroy(dstrFlags & ~DF_RELEASE); - childCursors.destroy(releaseCursors ? dstrFlags : dstrFlags & ~DF_RELEASE); + childBlobs.destroy(dstrFlags & ~(DF_RELEASE | DF_KEEP_NEXT)); + childCursors.destroy((releaseCursors ? dstrFlags : dstrFlags & ~DF_RELEASE) & ~DF_KEEP_NEXT); YAttachment* att = attachment.release(); if (att) @@ -5186,10 +5223,7 @@ void YTransaction::commit(CheckStatusWrapper* status) { YEntry entry(status, this); - entry.next()->commit(status); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{entry.next()->commit(status);}, [&]{entry.next()->commit_1(status);}); } catch (const Exception& e) { @@ -5217,13 +5251,11 @@ void YTransaction::rollback(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - if (entry.next()) - entry.next()->rollback(status); - if (isNetworkError(status)) - status->init(); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{ + entry.next()->rollback(status); + if (isNetworkError(status)) + status->init(); + }, [&]{entry.next()->rollback_1(status);}); } catch (const Exception& e) { @@ -5274,6 +5306,22 @@ void YTransaction::disconnect(CheckStatusWrapper* status) } } +void YTransaction::commit_1(CheckStatusWrapper* status) +{ + commit(status); +} + +void YTransaction::rollback_1(CheckStatusWrapper* status) +{ + rollback(status); +} + +void YTransaction::disconnect_1(CheckStatusWrapper* status) +{ + disconnect(status); +} + + void YTransaction::addCleanupHandler(CheckStatusWrapper* status, CleanupCallback* callback) { try @@ -5403,12 +5451,13 @@ void YAttachment::destroy(unsigned dstrFlags) cleanupHandlers.clear(); - childRequests.destroy(dstrFlags & ~DF_RELEASE); - childStatements.destroy(dstrFlags & ~DF_RELEASE); - childIscStatements.destroy(dstrFlags & ~DF_RELEASE); - childBlobs.destroy(dstrFlags & ~DF_RELEASE); - childEvents.destroy(dstrFlags & ~DF_RELEASE); - childTransactions.destroy(dstrFlags & ~DF_RELEASE); + unsigned childFlags = dstrFlags & ~(DF_KEEP_NEXT | DF_RELEASE); + childRequests.destroy(childFlags); + childStatements.destroy(childFlags); + childIscStatements.destroy(childFlags); + childBlobs.destroy(childFlags); + childEvents.destroy(childFlags); + childTransactions.destroy(childFlags); removeHandle(&attachments, handle); @@ -5863,14 +5912,11 @@ void YAttachment::detach(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_NONE); - if (entry.next()) - entry.next()->detach(status); - - if (isNetworkError(status)) - status->init(); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{ + entry.next()->detach(status); + if (isNetworkError(status)) + status->init(); + }, [&]{entry.next()->detach_1(status);}); } catch (const Exception& e) { @@ -5878,16 +5924,18 @@ void YAttachment::detach(CheckStatusWrapper* status) } } +void YAttachment::detach_1(CheckStatusWrapper* status) +{ + detach(status); +} + void YAttachment::dropDatabase(CheckStatusWrapper* status) { try { YEntry entry(status, this); - entry.next()->dropDatabase(status); - - if (!(status->getState() & IStatus::STATE_ERRORS)) - destroy(DF_RELEASE); + done(status, entry, this, [&]{entry.next()->dropDatabase(status);}, [&]{entry.next()->dropDatabase_1(status);}); } catch (const Exception& e) { @@ -5895,6 +5943,11 @@ void YAttachment::dropDatabase(CheckStatusWrapper* status) } } +void YAttachment::dropDatabase_1(CheckStatusWrapper* status) +{ + dropDatabase(status); +} + void YAttachment::addCleanupHandler(CheckStatusWrapper* status, CleanupCallback* callback) { try @@ -6101,10 +6154,7 @@ void YService::detach(CheckStatusWrapper* status) { YEntry entry(status, this, CHECK_WARN_ZERO_HANDLE); - if (entry.next()) - entry.next()->detach(status); - - destroy(DF_RELEASE); + done(status, entry, this, [&]{entry.next()->detach(status);}, [&]{entry.next()->detach_1(status);}); } catch (const Exception& e) { @@ -6112,6 +6162,11 @@ void YService::detach(CheckStatusWrapper* status) } } +void YService::detach_1(CheckStatusWrapper* status) +{ + detach(status); +} + void YService::query(CheckStatusWrapper* status, unsigned int sendLength, const unsigned char* sendItems, unsigned int receiveLength, const unsigned char* receiveItems, unsigned int bufferLength, unsigned char* buffer)