The EntitySpaces Community

Share and learn about the EntitySpaces Architecture.
Welcome to The EntitySpaces Community Sign in | Join | Help
in
Home Forums Photos

database value seems to have no effect in connection string

Last post 08-23-2007, 12:23 PM by sklett. 5 replies.
Sort Posts: Previous Next
  •  08-23-2007, 10:48 AM 4707

    database value seems to have no effect in connection string

    I have created a duplicate schema for development.  When I change the database property in my connection string, changes to entities are still being saved to the "old" database.  It really makes no sense.

    For example:

     

    Code:
    <EntitySpaces>
        <connectionInfo default="MYSQL">
          <connections>
            <add name="MYSQL"
              providerMetadataKey="esDefault"
              sqlAccessType="DynamicSQL"
              provider="EntitySpaces.MySqlClientProvider"
              providerClass="DataProvider"
              connectionString="Server=192.168.1.100;Database=pmd_manf2;Uid=sklett;Pwd=n0tagain!"
              databaseVersion="5"/>
          </connections>
        </connectionInfo>
      </EntitySpaces>

     If I change pmd_manf2 to pmd_manf2_test the changes are still saved to pmd_manf2

    Has anyone else experienced this? 

  •  08-23-2007, 10:54 AM 4708 in reply to 4707

    Re: database value seems to have no effect in connection string

    I added this code to check the the configuration settings were indeed being loaded correctly

     

    Code:
    string connString = esConfigSettings.ConnectionInfo.Connections[0].ConnectionString;

    When I inspect the value of connString it is correct, that is it points to pmd_manf2_test yet when I load a collection of entities they are being loaded from the pmd_manf2 database.  This is really odd.  I inspected the connections that were active on the server and there doesn't seem to be any cached ones, but I could be missing something.

  •  08-23-2007, 11:05 AM 4709 in reply to 4708

    Re: database value seems to have no effect in connection string

    I cleared my MySql log, then connected and loaded a collection.  Here is the log contents... interesting

     

    Code:
    070823 10:56:55	     19 Connect     sklett@STEVE-KLETT on pmd_manf2_test
    070823 10:56:56	     19 Query       SHOW VARIABLES
    		     19 Query       SHOW COLLATION
    		     19 Query       SET character_set_results=NULL
    		     19 Init DB     pmd_manf2_test
    		     19 Query       SELECT * FROM `pmd_manf2`.`tbl_users`

     As you can see, it connected to the correct database, but the SELECT statement from ES us using a different DB name.

    Any ideas why this is happening? 

  •  08-23-2007, 11:09 AM 4710 in reply to 4709

    Re: database value seems to have no effect in connection string

    I've also inspected the connectionString property of a collection.

    Code:
    1    CustomerCollection customers = new CustomerCollection();
    2 connString = customers.es.Connection.ConnectionString;
    3 customers.LoadAll();
    connString has the pmd_manf2_test database, so why in the world is ES using pmd_manf2 in the queries?? 
  •  08-23-2007, 11:53 AM 4711 in reply to 4710

    Re: database value seems to have no effect in connection string

    When you generated, did you check ignore Catalog? If not, it is hard coded in the metadata class for each EntitySpaces object.
    David Neal Parsons
    www.entityspaces.net
  •  08-23-2007, 12:23 PM 4714 in reply to 4711

    Re: database value seems to have no effect in connection string

    ahhhhh... man...

    Do I want to ignore schema or catalog or both?  I thought schema and catalog were the same things?  Are there any other effects from these options that aren't obvious? 

View as RSS news feed in XML