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.

java - Unique Key Constraint -


what's best practice in handling data insertion/update on table unique key constraints at application level? these came with:

1. run query on table before inserting data see if violate constraint.

pros

  • you have full control don't have deal dbms specific error messages.
  • addtional layer of data integrity check

cons

  • there might performance hit since there no constraint violation of time.
  • you need lock table while run query duplicate data.

2. nothing. update table , see sticks.

pros

  • simple!
  • faster overall since don't have run additional query everytime update table.

cons

  • your validation routine depends on database layer.
  • if data doesn't stick, have wade through stack trace find cause.

which 1 more accepted solution? there alternatives these?

i'm using java, jpa, hibernate, , spring btw. suggestions, framework specific, welcome!

thanks!

you've pretty sum up. if performance concern, go 2nd way. if integrity concern, go 1st way.

i favor integrity on performance. hardware pretty cheap, integrity not.

related questions:


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 -