Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

sql - Polling MySQL database through Qt / QSqlTableModel (C++) -


i'm using qt connect mysql database (through qsqltablemodel / qsqldatabase / etc) although question more general.

what's best way "live updating database table view"? 1 option poll entire table (repeatedly calling select() method in qsqltablemodel). seems inefficient though (is entire table passed mysql qt each time?)

another option have table, acts log table (keeps track of updates / changes) , can poll log table (checking new entries..which seems more efficient?). however, lose lot of qsql built in functionality).

or should have counter variable poll, , if increases, know refresh entire table?

all these approaches seem bit messy.. recommend? thanks.

this mysql question have answer! :)

what want in fact poll database every x seconds. however, make efficient if make mysql "trigger" if row inserted, updated, and/or deleted create indicator.

i think should create trigger insert modified row second table. poll qt program should these actions:

  • lock second "modifications" table
  • read entire contents of second "modifications" table
  • delete contents of second "modifications" table
  • unlock second "modifications" table

if dont lock table accidentally delete new row inserted between reading , deleting. however, if want/need avoid locking, read everything, delete rows retrieved based on unique id generated each row insertion "modifications" table.

the faq , documentation mysql triggers here: http://dev.mysql.com/doc/refman/5.0/en/faqs-triggers.html

documentation locking/unlocking tables here: http://dev.mysql.com/doc/refman/5.0/en/lock-tables.html


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -