In Azure, I have a database called Sismos, this was targeted by my WCF service, I created a copy of this database like this on Azure:
CREATE DATABASE sismos_cfe AS COPY OF Sismos;
This was because the initial database was only a for testing and will be used for other purposes and this new one will handle all the work for this WCF servive.
In my WCF service, I changed the following line in my Web.config file:
<connectionStrings>
<add name="Model1Container" connectionString="metadata=res://*/Sismos.csdl|res://*/Sismos.ssdl|res://*/Sismos.msl;
provider=System.Data.SqlClient;provider connection string="data source=*******.database.windows.net;
initial catalog=Sismos;persist security info=True;user id=*******;password=*****;
multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
With this:
<connectionStrings>
<add name="Model1Container" connectionString="metadata=res://*/Sismos.csdl|res://*/Sismos.ssdl|res://*/Sismos.msl;
provider=System.Data.SqlClient;provider connection string="data source=******.database.windows.net;
initial catalog=sismos_cfe;persist security info=True;user id=*****;password=******;
multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
And this line in my app.cofig file:
<connectionStrings>
<add name="Model1Container" connectionString="metadata=res://*/Sismos.csdl|res://*/Sismos.ssdl|res://*/Sismos.msl;
provider=System.Data.SqlClient;provider connection string="data source=******.database.windows.net;
initial catalog=Sismos;persist security info=True;user id=****;password=*****;
multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
With this:
<connectionStrings>
<add name="Model1Container" connectionString="metadata=res://*/Sismos.csdl|res://*/Sismos.ssdl|res://*/Sismos.msl;provider=System.Data.SqlClient;
provider connection string="data source=******.database.windows.net;
initial catalog=sismos_cfe;persist security info=True;user id=****;password=*****;
multipleactiveresultsets=True;application name=EntityFramework"" providerName="System.Data.EntityClient" />
</connectionStrings>
As you can see, I only replaced the value of the initial catalog
property, instead of pointing to Sismos, it now should point to cfe_sismos.
The problem I'm having is that when I try to access one of my endpoints that deals with deleting an entry in the database, no change is made in the database at all. With operations of selecting entries or editing/inserting an entry there's no problem. With the initial catalog
property value eing Sismos there's no problem with any of the endpoints, in theory any database access should be directed to the cfe_sismos database.
Was it not enough with me replacing the initial catalog
property value? Any help will be appreciated.
EDIT
I just noticed that there's also problems and odd behaviour when editing an entry, for example, if I have an entry in my table Users and I edit the Last_Name, the change won't be reflected when I check my database on Azure, but if I call the endpoint that returns the users, the change will be present, I gave some time to see if there was some kind of delay preventing from showing the newest values in Azure, but it didn't show any changes. How can I be making changes in the database without those changes being shown in the actual database? If I try to insert a new entry into a table, the entry will be shown with no problem.
So in summary, through my endpoints in my WCF service, if I insert something it will be shown in azure, if I edit something it won't be shown in Azure(but the change will be available when calling the respective endpoint) and if I want to delete something it won't be shown in Azure nor the change will be reflected when calling the endpoint.
If the database in Azure is not receiving any changes, then where am I getting all of the information? It's like a cached database exists somewhere, I'm really confused at the reason for this is happening.
I'm really confused at this odd behaviour, so I hope someone can help me. Thanks in advance.