| 266 | } |
| 267 | |
| 268 | bool IscConnection::resetSession(thread_db* tdbb) |
| 269 | { |
| 270 | if (!m_handle) |
| 271 | return false; |
| 272 | |
| 273 | if (!testFeature(fb_feature_session_reset)) |
| 274 | return true; |
| 275 | |
| 276 | FbLocalStatus status; |
| 277 | { |
| 278 | EngineCallbackGuard guard(tdbb, *this, FB_FUNCTION); |
| 279 | m_iscProvider.isc_dsql_execute_immediate(&status, &m_handle, |
| 280 | NULL, 0, "ALTER SESSION RESET", m_sqlDialect, NULL); |
| 281 | } |
| 282 | |
| 283 | if (!(status->getState() & IStatus::STATE_ERRORS)) |
| 284 | return true; |
| 285 | |
| 286 | if (status->getErrors()[1] == isc_dsql_error) |
| 287 | { |
| 288 | clearFeature(fb_feature_session_reset); |
| 289 | return true; |
| 290 | } |
| 291 | |
| 292 | ERR_post_nothrow(&status); |
| 293 | return false; |
| 294 | } |
| 295 | |
| 296 | // this ISC connection instance is available for the current execution context if it |
| 297 | // a) has no active statements or supports many active statements |
no test coverage detected