{"action":"created","issue":{"url":"https://api.github.com/repos/propelorm/Propel2/issues/1271","repository_url":"https://api.github.com/repos/propelorm/Propel2","labels_url":"https://api.github.com/repos/propelorm/Propel2/issues/1271/labels{/name}","comments_url":"https://api.github.com/repos/propelorm/Propel2/issues/1271/comments","events_url":"https://api.github.com/repos/propelorm/Propel2/issues/1271/events","html_url":"https://github.com/propelorm/Propel2/issues/1271","id":176611360,"number":1271,"title":"MSSQL - Uncaught 'PDOException' - \"attribute only supported on PDOStatement object\"","user":{"login":"MDT-FGI","id":21058652,"avatar_url":"https://avatars.githubusercontent.com/u/21058652?v=3","gravatar_id":"","url":"https://api.github.com/users/MDT-FGI","html_url":"https://github.com/MDT-FGI","followers_url":"https://api.github.com/users/MDT-FGI/followers","following_url":"https://api.github.com/users/MDT-FGI/following{/other_user}","gists_url":"https://api.github.com/users/MDT-FGI/gists{/gist_id}","starred_url":"https://api.github.com/users/MDT-FGI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MDT-FGI/subscriptions","organizations_url":"https://api.github.com/users/MDT-FGI/orgs","repos_url":"https://api.github.com/users/MDT-FGI/repos","events_url":"https://api.github.com/users/MDT-FGI/events{/privacy}","received_events_url":"https://api.github.com/users/MDT-FGI/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-13T11:03:39Z","updated_at":"2016-09-13T11:49:13Z","closed_at":null,"body":"Hello,\r\n\r\nI set up a project and had it working fine with MySQL. I now wanted to switch it to MSSQL and adjusted all the configs files as described in the documentation. Unfortunately I get the following error:\r\n\r\n> Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[IMSSP]: The given attribute is only supported on the PDOStatement object.' in H:\\xampp\\htdocs\\vendor\\propel\\propel\\src\\Propel\\Runtime\\Connection\\PdoConnection.php:85 Stack trace: #0 H:\\xampp\\htdocs\\vendor\\propel\\propel\\src\\Propel\\Runtime\\Connection\\PdoConnection.php(85): PDO->setAttribute(20, false) #1 H:\\xampp\\htdocs\\vendor\\propel\\propel\\src\\Propel\\Runtime\\Connection\\ConnectionWrapper.php(358): Propel\\Runtime\\Connection\\PdoConnection->setAttribute(20, false) #2 H:\\xampp\\htdocs\\vendor\\propel\\propel\\src\\Propel\\Runtime\\Connection\\ConnectionFactory.php(58): Propel\\Runtime\\Connection\\ConnectionWrapper->setAttribute('ATTR_EMULATE_PR...', false) #3 H:\\xampp\\htdocs\\vendor\\propel\\propel\\src\\Propel\\Runtime\\Connection\\ConnectionManagerSingle.php(76): Propel\\Runtime\\Connection\\ConnectionFactory::create(Array, Object(Propel\\Runtime\\Adapter\\Pdo\\MssqlAdapter)) #4 H:\\xampp\\htdocs\\vendor\\propel\\propel\\src\\Propel\\Runtime\\Connection\\ConnectionManagerSingle.php(90): Prope in H:\\xampp\\htdocs\\vendor\\propel\\propel\\src\\Propel\\Runtime\\Connection\\PdoConnection.php on line 85\r\n\r\nconfig.php:\r\n\r\n> <?php\r\n>  \r\n> return [\r\n>     'propel' => [\r\n>         'paths' => [\r\n>             'schemaDir' => 'H:/xampp/htdocs/vendor',\r\n>             'phpDir' => 'H:/xampp/htdocs/Models',\r\n>         ],\r\n>         'database' => [\r\n>             'connections' => [\r\n>                 'PMDB_Prod' => [\r\n>                     'adapter'    => 'mssql',\r\n>                     'classname'  => 'Propel\\Runtime\\Connection\\ConnectionWrapper',\r\n>                     'dsn'        => 'sqlsrv:server=xxxxx\\xxxxxx;Database=xxxxxxx',\r\n>                     'user'       => 'xxxxxxx',\r\n>                     'password'   => 'xxxxxxx',\r\n>                     'attributes' => []\r\n>                 ]\r\n>             ]\r\n>         ],\r\n>         'runtime' => [\r\n>             'defaultConnection' => 'PMDB_Prod',\r\n>             'connections' => ['PMDB_Prod']\r\n>         ],\r\n>         'generator' => [\r\n>             'defaultConnection' => 'PMDB_Prod',\r\n>             'connections' => ['PMDB_Prod']\r\n>         ]\r\n>     ]\r\n> ];\r\n\r\nAm I doing anything wrong or is this a bug right here?"},"comment":{"url":"https://api.github.com/repos/propelorm/Propel2/issues/comments/246656443","html_url":"https://github.com/propelorm/Propel2/issues/1271#issuecomment-246656443","issue_url":"https://api.github.com/repos/propelorm/Propel2/issues/1271","id":246656443,"user":{"login":"MDT-FGI","id":21058652,"avatar_url":"https://avatars.githubusercontent.com/u/21058652?v=3","gravatar_id":"","url":"https://api.github.com/users/MDT-FGI","html_url":"https://github.com/MDT-FGI","followers_url":"https://api.github.com/users/MDT-FGI/followers","following_url":"https://api.github.com/users/MDT-FGI/following{/other_user}","gists_url":"https://api.github.com/users/MDT-FGI/gists{/gist_id}","starred_url":"https://api.github.com/users/MDT-FGI/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MDT-FGI/subscriptions","organizations_url":"https://api.github.com/users/MDT-FGI/orgs","repos_url":"https://api.github.com/users/MDT-FGI/repos","events_url":"https://api.github.com/users/MDT-FGI/events{/privacy}","received_events_url":"https://api.github.com/users/MDT-FGI/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T11:49:13Z","updated_at":"2016-09-13T11:49:13Z","body":"I tracked this down to the file \"propel\\src\\Propel\\Runtime\\ActiveQuery\\Criteria.php\" where the attributes are set to the connection.\r\n\r\nA quick'n'dirty workaround looks like this:\r\nLine 60:\r\n>                 if ($option == \"ATTR_EMULATE_PREPARES\" || $option == \"ATTR_TIMEOUT\")\r\n>                 {\r\n>                     continue;\r\n>                 }\r\n>                 \r\n>                 $connection->setAttribute($option, $value);\r\n\r\nOf course this is not a solution and just for testing purpose..."}}
{"actor":{"display_login":"MDT-FGI"}}