| 666 | |
| 667 | |
| 668 | void InternalStatement::doClose(thread_db* tdbb, bool drop) |
| 669 | { |
| 670 | FbLocalStatus status; |
| 671 | |
| 672 | { |
| 673 | EngineCallbackGuard guard(tdbb, *this, FB_FUNCTION); |
| 674 | |
| 675 | if (m_cursor) |
| 676 | { |
| 677 | m_cursor->close(&status); |
| 678 | m_cursor.clear(); |
| 679 | } |
| 680 | |
| 681 | if (status->getState() & IStatus::STATE_ERRORS) |
| 682 | { |
| 683 | raise(&status, tdbb, "JResultSet::close"); |
| 684 | } |
| 685 | |
| 686 | if (drop) |
| 687 | { |
| 688 | if (m_request) |
| 689 | { |
| 690 | m_request->free(&status); |
| 691 | m_request.clear(); |
| 692 | } |
| 693 | |
| 694 | m_allocated = false; |
| 695 | |
| 696 | if (status->getState() & IStatus::STATE_ERRORS) |
| 697 | { |
| 698 | raise(&status, tdbb, "JStatement::free"); |
| 699 | } |
| 700 | } |
| 701 | } |
| 702 | } |
| 703 | |
| 704 | // We need to copy external blob from\to dynamic statement. |
| 705 | // If external blob is permanent one - we could use its blob_id and avoid |