Hi Kevin...

Currently, the only good source of info on how to develop for EJB 2.0 is 
the spec. But thats not so bad. The spec is very well written and has 
examples of code and descriptors. I will send you a 2.0 CMP example off 
list (I sent it off to Joe for inclusion on Orion Support, but it has not 
made it up there yet).

You can download the spec in PDF format from Sun. A bit of warning; it's 
about 530 pages long and has no fluff! I printed it double side on 3 hole 
punch and its a few inches. That said, it sounds worse than it is. Read 
chapter 9 several times. This is about 110 pages long and covers CMP in EJB 
2.0 (including relationships and dependent class objects). After reading 
it, you'll know what can be done and have a good idea how to do it.

Also, if you go to http://www.ejbnow.com there is a link to an article 
wrtten by Richard Monson-Haefel that covers the changes from EJB 1.1 to 2.0 
(although this article is a little out of date, it is almost completely 
correct still).

Read some of that, go through the example, then feel free to post your 
questions here. There are several of us (at least) active in 2.0 
development and I expect you'll get your questions answered.

In addition to big CMP improvements you'll see other nice enhancements, in 
particular the ability to use JMS for asynchronus actions. I feel 2.0 is a 
huge improvement.

**** WARNING WILL ROBINSON (dryer vent arms waveing, lights flashing) ****

But be warned!!!!! The current version of the EJB 2.0 spec is public draft 
2 and will probably change at least a little or maybe alot (probably only a 
little, though) before it is final. Further, be aware that only Orion and 
Weblogic have any portion of EJB 2.0 spec implemented. It could be as long 
as 2001 Q2 before you see servers with full EJB compliance (assuming the 
spec goes final this year).

Good luck!

Jim



--On Friday, October 27, 2000 3:48 PM -0700 "Duffey, Kevin" 
<[EMAIL PROTECTED]> wrote:

> Hi Jim (all),
>
> Thanks for the informative reply. Since what I am working on wont be in
> production for at least 3 or 4 months, I think I would rather start using
> EJB 2.0 capabilities. The problem is, every book on the market is all EJB
> 1.1..so how do you learn what you can do with EJB 2.0, how to make the
> calls, lookups, mappings, etc. The spec is almost certainly geared towards
> vendors, and its not an easy read..not to mention short! Can you point me
> to any docs, tutorials, etc that explain EJB 2.0, the differences, etc?
>
> Thanks.
>
>
>> -----Original Message-----
>> From: Jim Archer [mailto:[EMAIL PROTECTED]]
>> Sent: Friday, October 27, 2000 2:59 PM
>> To: Orion-Interest
>> Cc: Duffey, Kevin
>> Subject: RE: Can't call an EJB from Within another EJB
>>
>>
>> Hi Kevin...
>>
>> I have apps in which a servlet creates a stateless session
>> bean that in
>> turn creates an entity bean (or finds one that exists). It
>> runs fine. My
>> guess is that you have a deployment descriptor error if you
>> get a nameing
>> exception. Cjheck all your <EJB-REF> tags and remember that
>> they are scoped
>> to the bean in which they exist. If you want, for example, to
>> access a
>> PersonEB from two seperate beans, each of those seperate
>> beans needs an
>> <EJB-REF> entry within its definition for that PersonEB.
>>
>> As for EJB 1.1 CMP being very limited, yes it is. Very
>> limited (as you
>> said). This is why third party OR Mapping tools like CocoBase
>> have become
>> extremely popular. With them, you define your relationship
>> schema and it
>> makes BMP beans for you. But don't dispair! You have several options.
>> First, use BMP instead. Next, CocoBase (and TopLink, a
>> similar product)
>> cost one heck of a lot less then that testing tool you use for the
>> performance tests (and we all know how much venture money you
>> guys have -
>> grin). The best solution (and the riskiest right now) is to
>> use EJB 2.0.
>> This has a tremendousely powerfull scheme for modeling complex
>> relationships.
>>
>> We are developing for EJB 2.0 CMP in hopes of the spec going
>> final and
>> Orion supporting it fully soon. Hopefully, we will win that
>> bet. If we
>> don't, well... let's just say that the bleeding edge will
>> leave us with a
>> blood pressure of zero over zero.
>>
>> Jim
>>
>>
>> --On Thursday, October 26, 2000 12:14 PM -0700 "Duffey, Kevin"
>> <[EMAIL PROTECTED]> wrote:
>>
>> > I HAVE THE SAME PROBLEM!!! I was about to write an email to the
>> > list..hopefully someone else can answer this. Its pissing me off.
>> >
>> > My problem is that EJB A uses EJB B, but my servlet, when
>> it tries to get
>> > EJB A, throws the naming exception. The code in EJB A
>> hasn't even ran
>> > yet..and the stack trace says it can't find EJB B! That is
>> strange to me
>> > on why if the code in EJB A that uses B isn't even running
>> yet..just when
>> > the object is trying to be found, that it says it can't
>> find EJB B. Must
>> > be some mechanism of EJB containers that makes sure they all exist.
>> >
>> > My EJB A does a JNDI call to java:comp/env/ejb/Test and
>> that should work
>> > according to the ejb book I have. That is how a session bean uses an
>> > entity bean supposedly. From what I read, a session bean
>> (or I suppose
>> > any ejb) must use a JNDI lookup for every bean it wants to use. God
>> > forbid if I had a bean that needed to use 50 other beans!
>> Isn't there a
>> > way to simplify this process?
>> >
>> > Also, it appears EJB 1.1 entity CMP stuff is very
>> limited..VERY limited. I
>> > can't have any type of joins. How then is a join done? Does EJB A
>> > (session) that uses two entities, with entity A having a
>> join to entity
>> > B..does this have to be done in code? You have to get all
>> the entities of
>> > both A and B, then in code do a loop through all As and on
>> each iteration
>> > do a loop through all B's and if the fields of both that are in the
>> > "query" match, store that in a vector, then return that result? That
>> > seems like a whole lot of code just to do a simple one to
>> many join of
>> > two tables. It's enough to make me use standard JDBC sql, instead of
>> > entity CMP.
>> >
>> >> -----Original Message-----
>> >> From: J Davis [mailto:[EMAIL PROTECTED]]
>> >> Sent: Wednesday, October 25, 2000 10:21 AM
>> >> To: Orion-Interest
>> >> Subject: Can't call an EJB from Within another EJB
>> >>
>> >>
>> >> We have gotten our Orion server(1.3.8) to work with EJBs
>> on a singular
>> >> level(i.e. we can call EJB A, B or C and it works fine.)  But
>> >> If one of our
>> >> EJB's tries to call another(i.e. A calls B)  A throws a
>> >> naming exception
>> >> that it can't find the EJB reference when doing a jndi
>> >> lookup.  Is there a
>> >> dependency tag or something within one of the XML files that
>> >> denotes EJB
>> >> dependencies on one another?  I'm sure this is something
>> >> simple, but it is
>> >> getting annoying.
>> >>
>> >>
>> >>
>>
>>
>>
>>





Reply via email to