• 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
  • Tim Cooke
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Why a SFSB cannot be passivated in a transaction?

 
Ranch Hand
Posts: 95
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers!

Its a fact that statefull session beans cannot be passivated while in a transaction while an enity bean can.
Can any one tell me why this is not allowed?

I tried to search on almost all java forums but didn't find answer anywhere.

However, my point of view is that there may be some performance issues here.. like before passivation , the statefull session beans needs to close the open connections and re-aquire them when it is activated..

Regards,
Amit
 
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
its a good question.
waiting for some great explanation from someone.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think one issue in passivating a stateful session bean is that since it is associated with a single client, the state should be maintained across method calls.In case of an open transaction spanning multiple methods if the bean instance would have been passivated then there would be unnecessary overhead of restoring the state between method calls. In case of entity beans since they are not associated with a single client passivating an instance in a transaction would not be a problem.On a method call, if the previous instance has been passivated, the container can associate a new bean instance and load it with the data
 
cheenu Dev
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
can you just give some explanation with that one without using transaction.
 
Ranch Hand
Posts: 536
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I could be wrong, but here is what I think. Passivation of a session bean does not guarentee to repopulate the transient fields with their original values. So, think what might happen if you passivate a bean in the middle of a transaction? The end result might not be what you wanted.

Whereas in an entity bean, the container can synchronize the bean with the database anytime (using ejbLoad and ejbStore), so passivation would not be a problem.
 
paresh vernekar
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI Cheenu I didn't get your question.What do you mean by without transation?
 
cheenu Dev
Ranch Hand
Posts: 276
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
i just asked your explanation compared with:
session beans with transaction
session beans without transaction.

restoring the state between method calls


is it not required for session beans without transaction.
i am not understanding this.
 
Ranch Hand
Posts: 52
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Amit,

This is not an answer to your question, but can you given an example of a scenario where you would want a SFSB to be passivated while in transaction.
 
Ew. You guys are ugly with a capital UG. Here, maybe this tiny ad can help:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
reply
    Bookmark Topic Watch Topic
  • New Topic