This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • 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
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

Should I pass the record No. to GUI client?  RSS feed

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my project, when user book a contractor, should I find the record according to all the fields or the recNo in database for updating ?
I can use the findByCriteria function.
 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Long,

Originally posted by long lingyu:
In my project, when user book a contractor, should I find the record according to all the fields or the recNo in database for updating ?
I can use the findByCriteria function.


It depends on other design factors. For example if you are using locking from client side, there is no need to find the record with all the fields. You can just send the record number and book the record. On the other hand, if you are not using client side locking, then it is better to send the record along with the record number, find the record, see if the record has'nt modified meanwhile and if not book it. If modified, you can throw an exception if you want...again it depends on your design.
Hope it helps.
 
Ranch Hand
Posts: 319
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with Satish.
I used server side locking and passed my whole record, including record number, to client side. I then also passed record back to server when booking so that a check could be made whether it has been modified by somebody else.
J
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!