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

Time response while opening the data entry forms and switch to database #141

Open
mhabimana opened this issue Jun 25, 2018 · 7 comments
Open

Comments

@mhabimana
Copy link

mhabimana commented Jun 25, 2018

@africanmathsinitiative/climsoft I was trying to switch to another database but I am still seeing the old station list and yet I have changed the database name and port number under the configuration file. However,there is also a delay to open the form after double clicking this or after selecting the form and clicking ok on all the data entry form. I guess the data entry forms are not communicating directly with the database tables (e.g.station table,obselement). Note that the time response to open a data entry form is not too long but if possible it can be reduce such that once you double click on the form it opens this directly without any delay.

@Patowhiz
Copy link

@dannyparsons @volloholic @isedwards @maxwellfundi , I'm suspecting the issue of switching to a new database during runtime has to do with the Entity Framework app config file which has it pointed to the old database. I'm not quite sure on the best way to solve this and whether the EF model will allow changing of the database at runtime.

@Patowhiz
Copy link

@dannyparsons @volloholic @maxwellfundi on the matters of speed when it comes to loading of forms, we could start on querying the database once for all the forms. Currently we are doing 2 database calls in the populate control. The images below of the code snippets describe this. Any suggestions to this will help in reducing the delay.

code1

code2

@mhabimana
Copy link
Author

@africanmathsinitiative/climsoft :Is the switch to databases of choice fixed with the modification of EF? Please let me know.

@Patowhiz
Copy link

Patowhiz commented Jul 5, 2018

@mhabimana that has not yet been fixed.

@mhabimana
Copy link
Author

@africanmathsinitiative/climsoft : I am surprised to see that I switched to a new database but I am still seing the list of stations from the old database in the data entry forms. Does it means that data entry forms are not communicating directly with database tables? I think once you switch to a new database ,data entry forms should point to the new database and populate the content of this ( e.g. station table,,elements table,etc.). It seems that the list of station in the form is static rather than dynamic. Please let me know.

@Patowhiz
Copy link

The current implementation of the connection to the database is static and comes from a file named App.Config which has the connection properties of the database that the EF is connecting to. In my case, this file has the xml tag that tells the EF where to connect to .

<connectionStrings>
    <add name="mariadb_climsoft_test_db_v4Entities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=MySql.Data.MySqlClient;provider connection string=&quot;server=127.0.0.1;user id=root;password=mypassword;persistsecurityinfo=True;database=mariadb_climsoft_test_db_v4&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>

For now you can just change the database you want to connect to from there. As we think of how changing of the connection properties can be done during runtime.

@mhabimana
Copy link
Author

@Patowhiz : Thanks,it makes sense.

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

2 participants