Note that there are some explanatory texts on larger screens.

plurals
  1. POOverriding CDbCommand->queryInternal()
    primarykey
    data
    text
    <p>An existing yii-Framework application must be migrated to using <i>{pdo_,}sqlsrv</i> to communicate with the SQL-Server Backend as the entire application is being migrated from Lunix to Windows. </p> <p>There are several invocations of (immutable) stored procedures that yield multiple row sets. The legacy mssql-driver luckily ignored the former. Using sqlsrv, one has to use <code>sqlsrv_next_result()</code> on the result handle in order to avoid <code>SQLSTATE[IMSSP]: The active result for the query contains no fields</code> and skip on to the relevant/usable rowset.</p> <p>Being new to yii, I have found no way of introducing an extension to <code>CDbCommand</code> at a low enough level so that AR etc. will still function. My current solution thus directly modifies framework/library code which is obviously not an option once we go into production.</p> <p>This is my modification to the library (starting in CDbCommand.php#515):</p> <pre><code>$retry_hack = false; do { try { $result=$this-&gt;_statement-&gt;$method(); $retry_hack = false; // won't get here on throw } catch (PDOException $e) { // If we do not have any more rowsets we obviously have // a proper exception at this point and just re-throw // it to whomever wants to catch it. if (!($retry_hack = true === $this-&gt;_statement-&gt;nextRowset())) { throw $e; } } } while ($retry_hack); </code></pre> <p>Now my question: how can I introduce this behaviour at a low enough level without having to modify framework/library code?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload