Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

IBM287: EJB calling itself from Kushner's book

 
Luigi Smith
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Howard's book, he mentions avoiding using "this" (and I assume implicit, as well) when calling other business methods of the same EJB. Instead, call off the ejbContext to preserve transaction semantics. Agree there, but if you do this in an entity bean, would you have to mark the bean as "reentrant?"
Also, I am assuming by business methods he means method calls that may do other CRUD ops on the db, correct? I would tend to think that using "this" would be fine if you are calling helper methods in the same EJB to avoid having one monolithic method.
TIA!
Lou
 
Howard Kushner
author
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Luigi,
Perhaps I can explain what we are trying to say in the book. When you use this you cheat on the EJB container of the App Server, and that's not good. You should always use the services of the container, either through a local or remote reference, because the container provides all those cool services.
Now private within the bean are a different story. I would call them convenience methods, which are there when an EJB want to send messages private to itself.
Does that make sense? If not, please restate your question so I can better understand. Help me understand (perhaps with an example) a business method invocation from within a business method within an EJB. It is quite possible that I am not fully following your question.
Regards,
 
Luigi Smith
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howard,
Thanks again for the prompt reply and confirming what I thought the book meant.
So if I call those other "business" methods in the same EJB would that be considered "reentrant" and thus I would have mark the entity EJB as such? I'm asking this because I thought you have to label the EJB as reentrant if you re-enter into the bean on the same invocation.
Thanks,
Lou
 
Howard Kushner
author
Ranch Hand
Posts: 361
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Luigi,
To me, re-entrant would imply via the container using the public interface (remote or local) as opposed to the private helper method style of invocation. I am not sure why you would want to do that...
Perhaps it would help to clarify our definition of business method.
Regards,
 
Sri celamko
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howard,
I am new to websphere, I am trying to learn to work with it. Some of these questions which I came across for IBM 285 may be pretty rudimentary for u. Please help me find right answers to below questions.
___________________________________________________________________________
1. which of the following cannot be done through data perspective
a. browse and import schemas
b. create data source objects
c. create and execute sql statements
2. where are .class files stored in Java Project
a. same folder as .java files
b. build folder
c. in the same folder as specified when creating the java project

3. From which source is .war file of Sales Web Project created
a. sales/web content
b. sales/web-inf/classes
c. sales/web-inf
d. sales/web
e. sales
4. A Developer while compiling a class comes across lot of unqualified class name errors caused b'cos some of the classes where not imported are referenced. He wants to use Add Import feature how does he use it
a. select unqualified class name select add import from the menu
b. ctrl + a all the code select add import from the menu
c. from the menu java - import - click auto import on
I am not sure about the correct sentence for the last choice as I faintly remember the whole sentence but the nevertheless I am sure that the question is the same.
5. A developer wants to replace a word "pending" from referenced amd mentioned across the whole project. How does he do it?
I do not remember the choices presented for this question but all of them are related to search view or search menu. One choice however mentions about Global search option
6. A developer wants to know how to create, test and run projects which of the following is the quickest ways from which he can recieve the information.
a. use of cheat sheets
b. entering the topics from search menu in help
c. from help table of contents
7. Select the differences and similarities between Scrap book page and display view
a. codes in both can be versioned
b. codes in both can be saved from workbench
I dont remember the rest of the choices
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sri, welcome to JavaRanch!
Now for some unpleasantness. I'm letting this one indiscretion slide since you are new to the Ranch, but I will ask of you two things:
1) Don't hijack another person's post. In other words, posting your own questions. If you want a question, or questions, answered like you are asking, create your own post.
2) Don't post the same question in multiple posts.
From now on, please follow these guidelines or your posts will end up getting deleted.
 
Sri celamko
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for letting me know the rules, I will be sure to follow them next time around when I post something.
-sri
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic