Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSSQL - Driver does not support setting attributes (SQLSTATE[IM001]) #970

Closed
kinekt4 opened this issue Jul 20, 2015 · 1 comment
Closed

Comments

@kinekt4
Copy link

kinekt4 commented Jul 20, 2015

When making a connection to a MS SQL Server from Symfony2:

$con = Propel::getConnection('default');

I get the following error:

SQLSTATE[IM001]: Driver does not support this function: driver does not support setting attributes 

This happens when trying to set the following:

// app/config/config.yml
propel:
    database:
        connections:
            default:
              ...
              attributes:
                  ATTR_EMULATE_PREPARES:  true

However, even when this is removed, the error still persists because the DependencyInjector adds in a default:

// Propel\PropelBundle\DependencyInjection\Configuration
->arrayNode('attributes')
  ->addDefaultsIfNotSet()
    ->children()
        ->booleanNode('ATTR_EMULATE_PREPARES')->defaultFalse()->end()
    ->end()
->end()

If I remove like so, it works:

->arrayNode('attributes')
  ->addDefaultsIfNotSet()
->end()

Question: I wonder if the adapter should be checked before adding the default attribute ('ATTR_EMULATE_PREPARES) ?

Stack Trace

in vendor/propel/propel/src/Propel/Runtime/Connection/PdoConnection.php at line 76  -

        $attribute = constant($attribute);
    }
    return parent::setAttribute($attribute, $value);
}

adapter: mssql
driver: pdo_dblib
framework: symfony2
propel version: 2.0.0-dev

@kinekt4
Copy link
Author

kinekt4 commented Jul 24, 2015

Issue moved to PropelBundle: propelorm/PropelBundle#348

@kinekt4 kinekt4 closed this as completed Jul 24, 2015
@kinekt4 kinekt4 changed the title Driver does not support setting attributes (SQLSTATE[IM001]) MSSQL Driver does not support setting attributes (SQLSTATE[IM001]) Sep 21, 2017
@kinekt4 kinekt4 changed the title MSSQL Driver does not support setting attributes (SQLSTATE[IM001]) MSSQL - Driver does not support setting attributes (SQLSTATE[IM001]) Sep 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant