Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

EJB referencing question

Posted on 2004-08-23
6
Medium Priority
?
184 Views
Last Modified: 2013-11-24
can I reference another entity EJB in ejbCreate() method?

for example:
This is what I want to do in my entityA EJB

public int TrackRecord::ejbCreate (int data)
{
   InitialContext ctx = new InitialContext();

   CounterLocalHome home = (CounterLocalHome)ctx.lookup ("ejb/CounterLocalHome");

   counter = home.getPrimaryKey(1);

   this.rowId = counter.increment();
   this.data = data;

   return rowId;
}
0
Comment
Question by:zollen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 200 total points
ID: 11878617
I don't see why you couldn't.
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 11878631
What exactly do you want to do? What's the requirement that drives you to do that?
0
 
LVL 35

Expert Comment

by:girionis
ID: 11878641
Just try it and see if it works.
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 30

Expert Comment

by:Mayank S
ID: 11878669
It should work :) but what's the need to do that ;-) ?

I see a small design-flaw here. If this.rowId needs the value which it obtains from home.getPrimaryKey(1).increment.... can't that be done from outside the ejbCreate () method as well? The calling block of code can obtain that value and pass it from somewhere....
0
 
LVL 35

Expert Comment

by:girionis
ID: 11882923
:)
0
 

Author Comment

by:zollen
ID: 11886219
well. u are the first one to answer my question :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn different types of Android Layout and some basics of an Android App.
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Suggested Courses

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question