Win a copy of The Career Toolkit this week in the Jobs Discussion forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
  • salvin francis
  • Frits Walraven
  • Piet Souris

Conversational state - Session Bean

Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
EJB Specs - Section 7.4 Conversational state says:

The conversational state of a STATEFUL session object is defined as the session bean instance�s field values, plus the transitive closure of the objects from the instance�s fields reached by following Java object references.

Can some one please explain in simple words what they mean by transitive closure of the objects? :roll: An example would be appreciated.
Posts: 22
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Transitive closure in java parlance means recursive traversal of all objects referenced from within the bean's instance.

An example would be a Customer Session Bean with the following instance variables:Account & Profile (just consider these two instance variables as POJOs).

The Account object has the following definition:

public class Account
public String accountId;
public String accountName;
public Orders[] accountOrders;
public Profile aProfile;

public class Profile
public String profileId;
public String nickName;
public String preferredVendor;

public class Orders
public long orderNumber;
public String productOrdered;
private String notPartOfTransitiveClosure;


Transitive closure would imply that from an Account oject, say myAccount, we can do the following:

(1) You can refer to all Account object's instance variables (myAccount.accountId, myAccount.accountName,
myAccount.accountOrders, myAccount.aProfile)

(2) You can also refer to myAccount.aProfile.profileId, myAccount.aProfile.nickName, myAccount.aProfile.preferredVendor

(3) You are also able to access myAccount.[orderIndex].orderNumber, myAccount.[orderIndex].productOrdered
but, you will not be able to access myAccount.[orderIndex].notPartOfTransitiveClosure.

So, the object graph for Account object would be all the instance variables in myAccount plus recursively going through each reference (in this case, Account and Profile) to get to the lowest attribute reachable with the object reference.
Sandesh Tathare
Ranch Hand
Posts: 82
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I am really impressed with your answer. Really Gr8!

Thanks for example. It was good one.
Consider Paul's rocket mass heater.
    Bookmark Topic Watch Topic
  • New Topic