• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Idempotent???

 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly is Idempotent, which method is idempodent and which is not and how and why?

Thanks.
 
Nila dhan
Ranch Hand
Posts: 161
  • Mark post as helpful
  • send pies
  • 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
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • 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.
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Arjunkumar Shastry
Ranch Hand
Posts: 986
  • Mark post as helpful
  • send pies
  • 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 ]
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • 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: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • 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: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks a lot everybody.
 
ankur rathi
Ranch Hand
Posts: 3830
  • Mark post as helpful
  • send pies
  • 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.
 
Satish Chilukuri
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • 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: 3830
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Satish.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic