Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

change stateless to stateful session bean

 
James Foster
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Lets say I have a stateful session bean performing some business logic. Lateron, I find that I could have as well made it as stateless session bean. Do I just have to change the <session-type> to stateless? Or is there anything else I need to do?
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you used any latent state (e.g. instance variables) to hold information between method invocations you'd need to move that to a persistent store like a database.
Kyle
 
Sri Basavanahally
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, You may know that, If you change from Stateful to Stateless, any create() methods you have for stateful beans with arguments have to be changed to one create() method with no arguments for the stateless session bean.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic