| 5115 | |
| 5116 | |
| 5117 | JResultSet* JStatement::openCursor(CheckStatusWrapper* user_status, ITransaction* transaction, |
| 5118 | IMessageMetadata* inMetadata, void* inBuffer, IMessageMetadata* outMetadata, unsigned int flags) |
| 5119 | { |
| 5120 | JResultSet* rs = NULL; |
| 5121 | |
| 5122 | try |
| 5123 | { |
| 5124 | JTransaction* jt = transaction ? getAttachment()->getTransactionInterface(user_status, transaction) : NULL; |
| 5125 | |
| 5126 | EngineContextHolder tdbb(user_status, this, FB_FUNCTION); |
| 5127 | |
| 5128 | jrd_tra* tra = jt ? jt->getHandle() : NULL; |
| 5129 | |
| 5130 | if (tra) |
| 5131 | validateHandle(tdbb, tra); |
| 5132 | |
| 5133 | check_database(tdbb); |
| 5134 | |
| 5135 | try |
| 5136 | { |
| 5137 | RefPtr<IMessageMetadata> defaultOut; |
| 5138 | if (!outMetadata) |
| 5139 | { |
| 5140 | defaultOut.assignRefNoIncr(metadata.getOutputMetadata()); |
| 5141 | if (defaultOut) |
| 5142 | { |
| 5143 | outMetadata = defaultOut; |
| 5144 | } |
| 5145 | } |
| 5146 | |
| 5147 | const auto cursor = getHandle()->openCursor(tdbb, &tra, |
| 5148 | inMetadata, static_cast<UCHAR*>(inBuffer), outMetadata, flags); |
| 5149 | |
| 5150 | rs = FB_NEW JResultSet(cursor, this); |
| 5151 | rs->addRef(); |
| 5152 | cursor->setInterfacePtr(rs); |
| 5153 | } |
| 5154 | catch (const Exception& ex) |
| 5155 | { |
| 5156 | transliterateException(tdbb, ex, user_status, "JStatement::openCursor"); |
| 5157 | return NULL; |
| 5158 | } |
| 5159 | trace_warning(tdbb, user_status, "JStatement::openCursor"); |
| 5160 | } |
| 5161 | catch (const Exception& ex) |
| 5162 | { |
| 5163 | ex.stuffException(user_status); |
| 5164 | return NULL; |
| 5165 | } |
| 5166 | |
| 5167 | successful_completion(user_status); |
| 5168 | return rs; |
| 5169 | } |
| 5170 | |
| 5171 | |
| 5172 | IResultSet* JAttachment::openCursor(CheckStatusWrapper* user_status, ITransaction* apiTra, |
no test coverage detected