Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CMP-CMR relationships ejbActivate and EJB Performance

 
Mallik Hiremath
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me explain the CMP-CMR relationships and the problem!!
Say we have Employee (CMP-EJB) maps to EMPLOYEE_TBL
and Dept (CMP-EBJ) maps to DEPT_TBL
in EMPLOYEE_TBL there is a Dept_FK that maps to Dept_ID in DEPT_TBL
Say there are 2 Million employees ( Imaginary company ! )
out of these 2 Million say 1 Million belongs to Dept 1.
As per EJB specification set the Dept_FK relationship of the Employee Bean in its ejbPostCreate() method.
Now try to add one more employee to Dept 1,
while the Dept_FK CMR relationship is being set to this Employee Bean in the ejbPostCreate() method of EmployeeBean the container will call ejbActivate() method 1 million + 1 times and then sets the relationship of new Employee with Dept 1 EJB, then calls the ejbStore method of this new Employee.
Then again try to add one more Employee to same dept 1, this time its going to call ejbActivate() for 1 Million + 2 times !!!
What is going on here? Is this how the CMP beans supposed to work? or am I missing some settings in orion-ejb-jar.xml or any other config file?
I am using OC4J 904 on win2000 with oracle DB, would like to know how other EJB Servers doing on this issue?
Thank you
Mallik
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic