This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

javax.ejb.EJBException: Attempt to access a collection valued cmr-field outside  RSS feed

 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a self referencing EJB. I'm using CMR/CMP to achieve this.
I know it can be done using link -tables as well. But we don't want to use it.
There can be only parent for a child.
I have a Node that has a parent that refers to Node back.
table Node{
id,
name,
parent_id
}
I want to be able to get all childs of a node given a node id. So i guess this is a Many-One relationship?
class Node{
String name
java.util.Set nodes;
}
1. Am able to do a lookup on node using findByPrimaryKey
2. am even able to set the name attribute.
3. When i do getNodes() i get a Set instance
BUt the moment i do an operation on the java.util.Set instance i get this exception.
Can someone tell what has gone wrong here?.
I guess there is a problem with my descriptor??
Am using weblogic6.1
javax.ejb.EJBException: Attempt to access a collection valued cmr-field outside
the scope of a transaction.
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
solved it. For testing purposes I was directly accesing a collection CMR from within a JSP.
now am accesing it thro' a session bean and it 's workign ok
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!