PDA

View Full Version : Database (MySQL) records blocking and updating question.



inbush
15th October 2011, 15:25
Hello, everybody!
I'm newer in Qt, so I have several questions according working with MVC pattern with DB datasources.
1. Does MVC pattern realization supports the block records mechanism? and if it doesn't how to realize it in the true way. (the question is relevant for using QSql(Relational)DataModel). For example we have mysql DB with one table and 2 users. The first user starts to edit the first record in the table then the second user starts to do the same thing but before that moment when the first user commit data. So is there any way to prevent the editing data process while it working from another user?
2. How to show changes in data source (db mysql) when it is changed by another user. For example. we have mysql DB with one table and 2 users. The first user adds recors in the table. but it seems to me that the secon user wouldn't see it teel the select method would be called. Is there any mechanism that provides the automatic model update when the DB source is changed or I need to call select method for example every 5 seconds.

Thanks.

PS. Sorry for my english.