• 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

Idempotent???

 
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What exactly is Idempotent, which method is idempodent and which is not and how and why?

Thanks.
 
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
idempotent is something(for eg a resource) which is not changed or modified in any case.The Get method is idempotent whereas the post method is not.Am i right?cud anybody verify
 
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Idempotent methods are one which returns the same result. For example multiply(a,b). The method does not have any side effect. The HTTP GET methods method is supposed to be idempotent whereas POST is not.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Jayson Falkner said:

An Idempotent operation is an operation that if run multiple times has no affect on state -- that is, it is query only not update.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by nila dhan:
The Get method is idempotent whereas the post method is not.Am i right?cud anybody verify



Quite right. Learning, it is good.
 
Ranch Hand
Posts: 999
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes.
Mathematically,if R is some set and if it holds Associative/distibutive/closure properties and if some element x of R has the property such that x*x = x then element x is said to be idempotent.
For example ,any square identity matrix should be idempotent.
[ September 30, 2005: Message edited by: Arjunkumar Shastry ]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The original design of the GET method was to be idempotent (in the dark, early days of the internet) but this is the intent and should not be taken as fact.
 
Pradeep bhatt
Ranch Hand
Posts: 8945
Firefox Browser Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by David O'Meara:
The original design of the GET method was to be idempotent (in the dark, early days of the internet) but this is the intent and should not be taken as fact.



I have seen lot of web applications where GET is used to update data at the server side.
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot everybody.
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On page 114 of HFSJ, at the bottom, this is written: "Post is considered idempotent by the HTTP 1.1 specs".

And just before 2 or 3 pages to this, they are writing that, when ever it is post think of update.

So post can't be idempotent (it may be but we should not consider it idempotent).



Thanks.
 
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

On page 114 of HFSJ, at the bottom, this is written: "Post is considered idempotent by the HTTP 1.1 specs".

And just before 2 or 3 pages to this, they are writing that, when ever it is post think of update.

So post can't be idempotent (it may be but we should not consider it idempotent).



Actually thats a mistake. It is mentioned in the errata http://www.oreilly.com/catalog/headservletsjsp/errata/headservletsjsp.confirmed
 
ankur rathi
Ranch Hand
Posts: 3852
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Satish.
 
reply
    Bookmark Topic Watch Topic
  • New Topic