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

Compound Primary Key Problem  RSS feed

 
Nayyer Kamran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I faced a problem while developing a CMP entity bean with a compound key. Problem is if I change one of the primary key fields and then call some fn over the same bean exception occures. The exception is
"nayyerjava.rmi.NoSuchObjectException: Exception in ejbLoad:javax.ejb.NoSuchEntityException: Bean with primary key: '10Adeel' not found. "
This is because that container does not change its refrence with the field change should it not do that?
does ejb specification discuss this problem as its not that much unusual bahaviour.
is there some solution.
Thanks
Nayyer Kamran
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you also change your primary key class? Is is the same name? Is the name correct in the deployment descriptor?
 
Nayyer Kamran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Hildner:
Did you also change your primary key class? Is is the same name? Is the name correct in the deployment descriptor?

Dear Michael problem is not the one that understand. These are the events sequence
Lookup the bean with JNDI name (Successful)
Creating the bean with a primary key(cosposite) (Successful)
Change one of the fields of the primary key e.g primary key is ID and Name and I created the bean with ('10','Adeel') later I change name from Adeel to 'Nayyer' by calling bean method changeName(String name); this change also reflects in my database so that means the changing is successful. after that if I go to execute any method on the same bean previously created it throws the exception which mention that server is trying to find out the bean with the same old ID and name.
Now I want to know that does ejb specification discuss this problem and its solution.
and what should I do to over come this problem.
Nayyer
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I misunderstood at first. You're not using WebLogic 6.0 are you?
 
Nayyer Kamran
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Michael Hildner:
Sorry I misunderstood at first. You're not using WebLogic 6.0 are you?

I am using weblogic 6.0 Evaluation Version recently downloaded
Nayyer
 
Michael Hildner
Ranch Hand
Posts: 297
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This smells just like a problem we had with WL6 and spec 9.6.2. This has to do with being guaranteed null values immediately after ejbCreate, which was not the case. Fields still had info from previous beans, presumably beans that were still in the pool getting reused.
I would report this to WL. The only workaround is probably illegal - decompile their classes, see what they're doing and try to fix it.
Best of luck.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!