Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Doubtful in Statefull Session Bean (SFSB)  RSS feed

 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends..

I'm trying to learn SFSB..
I'm confused about state management SFSB..
I've created SFSB instance like this below :



then i tried to add new state to that SFSB, through AddSFSBServlet (which addressed at http://localhost/MyApp/AddSFSBServlet ), and the AddSFSBServlet's content is like this below :



and then i wanna to display all states handled by SFSB, through ShowSFSBServlet (which addressed at http://localhost/MyApp/ShowSFSBServlet ), and the ShowSFSBServlet's content is like this below :


but it displayed anything.. just [] (it's mean that the states is empty.. )

Please help me..

Thanks in advance..
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The SFSB injected in AddSFSBServlet and ShowSFSBServlet will not be the same instance of the SFSB. As a result, you are seeing different states.
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Jaikiran Pai for your reply..

is it mean i've to create CRUD (Create, Read, update, Delete) to SFSB state with only AddSFSBServlet?..
and all of the operations grouped in a Servlet?..
then, how to achieve it?..
do i've to create a servlet with several Http methods such as PUT, POST, DELETE, GET which used for represent CRUD operation?..

POST represent Create
PUT represent Update
DELETE represent Delete
GET represent Read

and i'm still confused how to test SFSB in multiple different thread?..
what i mean is.. i want to open 2 or 3 different browsers then i log on with different user.. and then i add each user cart..
and last i want to check each cart content..

sorry perhaps my english not too ease understood..

Thanks in advance..
 
Leonardo Carreira
Ranch Hand
Posts: 494
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops.. i was wrong..

Probably i can use only POST and GET Method with parameters..
and tell Servlet to do what i want, such as adding, selecting, computing, updating and deleting an item..

Please correct me if i'm still wrong..

Thanks in advance..
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!