• 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
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

Transaction

 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
Why a method require transaction form previous method,why it not create a new transactin?
Thanks.
 
Ranch Hand
Posts: 275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Parinya Hirunpunthaporn:
Why a method require transaction form previous method,why it not create a new transactin?


The deal with transactions is that you have more than one "thing" you want to accomplish, and this group of "things" must all be executed properly, or none at all. So you need to run several methods in a single transaction so you can commit all actions or rollback all actions.
Like at the cash machine... the bank always wants to run both methods reduceBalance(10000) and ejectCash(10000).
--Dale--
PS: How much can 10000 rupis buy you nowadays?
 
Parinya Hiranpanthaporn
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot Dale.
 
reply
    Bookmark Topic Watch Topic
  • New Topic