• Post Reply Bookmark Topic Watch Topic
  • New Topic

Idempotency  RSS feed

 
Hari babu
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
In my application i use clustering and the application involves only session beans (no entity). Do i need to take care of idempotency in this scenario? or is it applicable only when we have entity beans ?
Hari
 
Chris Mathews
Ranch Hand
Posts: 2712
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The concept of idempotence applies equally to Entity Beans and Session Beans.
First let's go over what idempotence is:
An object is considered idempotent iff any method can be called multiple times with no differing effects than calling the method once. In other words, your methods must have no permanent side effects.
Therefore, if your object ever writes to persistent storage, then it is not considered idempotent. If your object stores information in a session, then it is not considered idempotent.
If your object is "read-only" then it may be considered idempotent, depending on the needs of the application.
No Application Server will assume that an EJB, or a method on an EJB, is idempotent. You must go out of your way, in a vendor-specific manner, to tell the Application Server this information. In general, if you are not sure then don't mess with these settings.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!