• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to prevent a wild use of a program?

 
Ranch Hand
Posts: 634
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where should be the best place to make a try catch block?
And should I limit the number of active transactions in a sales addition screen for example?
to prevent "abuses" and make the software unstable?
(If he/she needs to add 100000 records, he/she has to do it twice)
Is such control reasonable? But I doubt it....
Just a thought...
Thanks
Jack
 
Bartender
Posts: 10780
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Jacky Luk wrote:Where should be the best place to make a try catch block?


IMO: As little as possible; and not at all if you can get away with it.

Maybe more specifically: if you have a bunch code that, for example, reads a file, put ALL the code inside one try...catch (or try-with-resources) block - ie, don't put a try...catch around every record you read. And don't put it in a TC block at all if your program can't recover from an IOException.

And should I limit the number of active transactions in a sales addition screen for example?


No idea, but the general rule is that transactions should be as small as makes sense for the business rules.

to prevent "abuses" and make the software unstable?
(If he/she needs to add 100000 records, he/she has to do it twice)


Who has to add 100,000 records? I imagine if it was done by hand, it would take months...

Is such control reasonable? But I doubt it....


Absolutely no idea because you've given us nothing to work with. All I can say is that "such control" is probably available.

Winston
 
Life just hasn't been the same since the volcano erupted and now the air is full of tiny ads.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic