• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Can Session bean and Entity Bean talk??

 
rastin purr
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there guys,
I am not clear about a few points. Can someone kindly clearify it for me please. Thanks!
I presume a session bean can lookup for an entity bean. Is that correct? I need to lookup an entity bean from a stateless session bean. Is that possible? I keep a copy of the entity bean home interface in the session bean. Should I keep it as the home interface or its home handle? I presume both are possible. If so which is better? I get the home reference duing the setSessionContext method of the session bean is that correct? I make methods call through the home interface in the business method of the session bean, is that allowed?
Anyone know if the above could be tested using Forte for Java 4.0 Ide? It could generate a test module. Any ideas how to test it?
I have problems with the above. I created the entity bean tested it and it works fine but when it home methods was called from a session bean business methods, it throws exception TransactionRolledBack exception it was thrown from the setEntityContext of the entity bean. Is it that the context is null? the error message is just "null". It wouldn't allow me to call any home methods of entity bean from the session bean business method. It it something to do with the transaction? The trasactions are cmt "requred" (default).
Please help. Thanks a lot Java Rangers
Ras
 
Kyle Brown
author
Ranch Hand
Posts: 3892
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try reading this article and this article. Also, taking a look at a good introductory EJB book like Ed Roman's or Richard Monson-Haefel's might help.
Kyle
 
rastin purr
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Kyle,
Thanks for the advice. The two articles are great.
ras
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic