java.lang.IllegalStateException: Attempted to access the collection valued cmr-field, 'customers', for bean, 'BranchEJB', outside the scope of a transaction. All access to the collection must be performed during the transaction in which the collection was initially retrieved.
The code goes like this.................
public Collection getBranchCustomers(String branchName)
{
Vector vCustomers = null;
try
{
//look up branch home
...
Branch objBranch = objBranchHome.findByName(branchName);
if (objBranch != null)
{
//get customers
//'customers' is a CMR field, one-many CMR is defined between branch and customer
Collection cCustomers = objBranch.getCustomers();
vCustomers = new Vector(cCustomers.size()); //I get the exception at this line
Iterator itr = vCustomers.iterator();
//customer name collection to be returned
while (itr.hasNext())
...
...
...
both branch and customer EJB's have local interfaces only and all methods have tx attributes as 'NotSupported' . The API getBranchCustomers in session bean has the same tx attribute. so what is the problem here???
[ December 29, 2003: Message edited by: Rashmi Tambe ]