• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

Can I use delete flag as status flag so to trace consistency issue?

 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Right now delete flag 0 means OK and 1 means deleted. If regard it as a status flag, I can add status 2 means intermediate result (dirty status). So when we update a row and suddenly server powers off, we can still tell which rows are in dirty status. Of cause when the update complete we reset it back to 0.

What do you think? After all dirty data cannot be used.
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is not required, so just don't do it. It will overcomplicate (and maybe clutter) your code. Easy, simple code is preferred above more complex code. You won't get extra credit for little extras you put in the application, you might only loose points because it might not be flawless
 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree. I used to do stuff like that earlier in my career, but have since stopped. Though it seems to save time during development, those early gains are erased when it comes time to perform maintenance - you'll find yourself cursing those fields that have more than one use, like 'a combo delete-flag and status flag' or 'a combo delete-flag and last update date flag'. They make things confusing, fragile, and resistant to change.
 
You can't have everything. Where would you put it?
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic