If you want "db specific sql", you are by definition disallowing CMP.
What specific relationships do you want to model?

Using sequences (or the equivalent) are not supported in EJB.  I find
this a little wierd myself, since nobody seems to have come up with a
really good mechanism for generating simple primary keys.  You can use
counter beans (Orion includes one in the news-app demo) for this
purpose, and unless you're rapidly creating zillions of keys,
performance is probably not going to be an issue.

My problem with EJB2.0 container managed relationships is that it adds
an enormous amount of binding between my data objects.  One software
engineering design goal is to decouple objects as much as possible so
they can be independently reused.  But I'm finding that my entity beans
are a web of interrelated objects that are intimately tied by their
relationships.  I don't know if this is going to be a problem down the
road, but if I were looking at a C++ or Java class diagram with this
much binding I would be inclined to refactor extensively.

My observation so far, though, is that a data model which can be modeled
in an RDBMS which can't be modeled in EJB2.0 CMR has got to be pretty
obscure.   I've got some pretty wacky relationships and it all works
reasonably well.

Jeff Schnitzer
[EMAIL PROTECTED]


> -----Original Message-----
> From: Cory Adams [mailto:[EMAIL PROTECTED]]
> Sent: Saturday, October 21, 2000 12:11 AM
> To: Orion-Interest
> Subject: RE: EJB Help..
> 
> 
> Jim,
> 
> How could a CMP managed entity bean handle a create for say an Oracle
> database table that used db specific sql for describing the 
> key using a
> sequence?  
> 
> Where the sql itself might look like
> 
> insert into customer (id, name, address) values(cust_sequence.NEXTVAL,
> "Jim" "12 Willow Street");
> 
> Maybe this is trivial.....  
> 
> Better yet could I ask you to provide some of the sources of 
> information
> that you use to help all of us better understand how to do 
> CMP with perhaps
> complex RDBMS entity relationships?
> 
> Thanks,
> 
> Cory
> 
> At 09:07 PM 10/20/00 -0400, Jim Archer wrote:
> >What types of relationships do you feel EJB 2.0 can't 
> adequately support? I 
> >have been studying 2.0 CMP carefully, and it seems to be 
> quite powerfull. 
> >There may be holes in it, but it can handle the majority of 
> real works 
> >cases.
> >
> >Jim
> >
> >
> >--On Friday, October 20, 2000 12:28 PM -0700 
> [EMAIL PROTECTED] wrote:
> >
> >> If you don't use an object-relational mapping tool you're 
> still in for a
> >> lot of hurt with EJB if you have a complex data model. I 
> don't think CMP
> >> really addresses the kind of data models large systems 
> have. Nor does the
> >> relationship support in EJB 2.0 either. I think you'll end 
> up doing JDBC
> >> BMP with your Session and Entity beans. Performance is 
> only an issue when
> >> you make everything a stateful session bean or an entity 
> bean. There are
> >> rules for when it's appropriate to make things entity 
> beans. There still
> >> isn't a whole lot of useful information around on design 
> EJBs yet though
> >> with most of it only explaining the basics including the ORA book.
> >>
> >> On Fri, 20 Oct 2000, Duffey, Kevin wrote:
> >>
> >>> Thanks.
> >>>
> >>> I only meant to use the /classes folder because my ejb 
> code is in the
> >>> same project as the rest of my code (Servlets, javabeans, action
> >>> classes, etc). Since it all compiles to the same one 
> folder, I assume I
> >>> will have to "move" the ejb compiled classes every time I 
> compile them.
> >>> What I was hoping for was a way to not have to do 
> this..instead, just
> >>> let the whole project compile to the WEB-INF/classes 
> folder (all my
> >>> code), and then have Orion pick up on the ejb changes 
> from that point.
> >>> It appears to me from what everyone is saying I will have 
> to use some
> >>> sort of script every time I make a change to an ejb, 
> which my first
> >>> thoughts is a pain in the ass. Its very easy to develop 
> servlets, action
> >>> classes, javabeans, core classes, but ejb not only 
> requires 3 classes
> >>> per component, but lots of "special" work just to get the thing
> >>> deployed. Then, every time you make a change, it requires the same
> >>> process. I would think turn-around time for ejb 
> development is on the
> >>> order of a couple of minutes for every change you make. 
> That results in
> >>> a lot slower development cycle than I am currently using.
> >>>
> >>> Worse, I have started hearing alot of people turn away 
> from ejb and going
> >>> back to servlets because of development time, and 
> performance. Supposedly
> >>> the ejb stuff isn't living up to all the hype. However, I 
> look at what
> >>> the ejb container does for you (connection pooling, transactions,
> >>> security, instance pooling, etc) and it seems there is 
> alot of stuff I
> >>> wont have to do on the side of persistence, transactions and
> >>> security..so maybe the extra time is worth it? ;)
> >>>
> >>> Anyways..I did as one person suggested in this list, I 
> set up in my
> >>> application.xml like so:
> >>>
> >>> <module>
> >>>   <ejb>/path/www/WEB-INF/classes/</ejb>
> >>> </module>
> >>>
> >>> and Orion seems to be finding the classes (the ejb). 
> However, I keep
> >>> seeing an error appear. It says something like:
> >>>
> >>> Error compiling class c:/path/www/WEB-INF/classes/  Login.java
> >>> LoginBean.java LoginHome.java  can't find method create()in
> >>> LoginBean.java
> >>>
> >>> Its a very strange message to me. If I change the 
> <module> path, it
> >>> tells me it can't find the classes. If I delete the 
> classes, it also
> >>> tells me it can't find them. So I assume the path is set 
> correctly in
> >>> the module <ejb> tag..as it is finding the classes. I am 
> just not sure
> >>> why the heck its giving me some compiler error..or why 
> its even trying
> >>> to compile them..they are already compiled.
> >>>
> >>> Anyways..I'll keep plugging away.
> >>>
> >>>
> >>> > -----Original Message-----
> >>> > From: Stanislav Maximov [mailto:[EMAIL PROTECTED]]
> >>> > Sent: Thursday, October 19, 2000 6:34 PM
> >>> > To: Orion-Interest
> >>> > Subject: RE: EJB Help..
> >>> >
> >>> >
> >>> > Kevin,
> >>> > look inside the news-application example bundled with Orion,
> >>> > lots of things
> >>> > will become clear for you after that.
> >>> > <www-dir>/WEB-INF/classes directory is for servlet classes,
> >>> > not for EJBs.
> >>> > You'll see how to deploy EJBs in that example and in
> >>> > documentation as well.
> >>> >
> >>> > stas@
> >>> >
> >>> > > -----Original Message-----
> >>> > > From: [EMAIL PROTECTED]
> >>> > > [mailto:[EMAIL PROTECTED]]On Behalf Of
> >>> > Duffey, Kevin
> >>> > > Sent: Friday, October 20, 2000 3:45 AM
> >>> > > To: Orion-Interest
> >>> > > Subject: RE: EJB Help..
> >>> > >
> >>> > >
> >>> > > Thanks for the note. One thing..since I compile all of my
> >>> > classes into the
> >>> > > www/WEB-INF/classes dir, should I put a META-INF in the
> >>> > /classes dir, and
> >>> > > just point the module to the WEB-INF/classes folder? Would
> >>> > that work?
> >>> > >
> >>> > > Not that I want you to tell me everything, ok..I do, but
> >>> > what exactly do I
> >>> > > need to get EJB deployed in that way? My first stab that I
> >>> > want to do is
> >>> > > create a login process. I would like to use statless session
> >>> > > beans, and also
> >>> > > use an entity bean..using CMP. I created 3 classes, Login,
> >>> > LoginBean and
> >>> > > LoginHome. I have them in com.mycompany.ejb package. That
> >>> > compiles to
> >>> > > www/WEB-INF/classes dir. So do I make application.xml like so:
> >>> > >
> >>> > > <module>/www/WEB-INF/classes</module>
> >>> > >
> >>> > > where the com folder starts? Or do I actually have to 
> point them
> >>> > > directly to
> >>> > > the .class files themselves? If the classes are compiled in
> >>> > a package, I
> >>> > > assume I need to point the ejb module setting to the root
> >>> > package right?
> >>> > > Furthermore, do I need that ejb.xml file in META-INF? 
> If so, what
> >>> > > should it
> >>> > > be set to if I am using an expanded dir? Lastly, how the
> >>> > heck to I get the
> >>> > > entity bean added..is that a forth class, or a whole set of
> >>> > 3 different
> >>> > > classes, one being the entity bean, the other two being
> >>> > like the home and
> >>> > > remote objects? It seems kind of silly that I would need 6
> >>> > > classes to do the
> >>> > > login process..3 for the session/logic stuff, and 3 for the
> >>> > > entity/database
> >>> > > mapping.
> >>> > >
> >>> > > Thanks so much..I appreciate the help.
> >>> > >
> >>> > >
> >>> > > > -----Original Message-----
> >>> > > > From: Mike Cannon-Brookes [mailto:[EMAIL PROTECTED]]
> >>> > > > Sent: Thursday, October 19, 2000 3:39 PM
> >>> > > > To: Orion-Interest
> >>> > > > Subject: RE: EJB Help..
> >>> > > >
> >>> > > >
> >>> > > > Kevin,
> >>> > > >
> >>> > > > With any *ar file in Orion, you can use a directory instead.
> >>> > > >
> >>> > > > eg
> >>> > > > <module>
> >>> > > >     <ejb>./myejbs.jar</ejb>
> >>> > > > </module>
> >>> > > >
> >>> > > > can just be
> >>> > > >
> >>> > > > <module>
> >>> > > >     <ejb>./myejbs</ejb>
> >>> > > > </module>
> >>> > > >
> >>> > > > where ./myejbs is a directory structure which has the
> >>> > same structure
> >>> > > > (META-INF directories etc) as inside the myejbs.jar
> >>> > > >
> >>> > > > Mike
> >>> > > >
> >>> > > > -----Original Message-----
> >>> > > > From: [EMAIL PROTECTED]
> >>> > > > [mailto:[EMAIL PROTECTED]]On Behalf Of
> >>> > > > Duffey, Kevin
> >>> > > > Sent: Friday, October 20, 2000 5:37 AM
> >>> > > > To: Orion-Interest
> >>> > > > Subject: EJB Help..
> >>> > > >
> >>> > > >
> >>> > > > Hi all,
> >>> > > >
> >>> > > > I am trying my hand at EJB with Orion, and I am wondering if
> >>> > > > there is any
> >>> > > > way to avoid the hassle of always having to package the ejb
> >>> > > > classes into a
> >>> > > > .jar file, and so on. Is there any way at all to develop and
> >>> > > > deploy ejbs
> >>> > > > using an expanded dir structure, much like in the 
> development
> >>> > > > of a .war
> >>> > > > file..where you have the whole www dir, WEB-INF, etc
> >>> > > > expanded..but then jar
> >>> > > > it up and rename it to .war for deployment? It seems rather
> >>> > > > tedious on ejb
> >>> > > > development every time a change is made, the whole 
> thing has to be
> >>> > > > repackaged and deployed. I know there are some 
> tools, such as
> >>> > > > JBuilder,
> >>> > > > VisualCafe, etc that do this for you somewhat nicely..but
> >>> > > > even those take a
> >>> > > > little bit of time to do it. So, for the purposes of
> >>> > > > development, where many
> >>> > > > changes are happening on any regular basis, how can 
> I quickly
> >>> > > > develop and
> >>> > > > test ejb, with Orion, or any app server for that matter.
> >>> > I do want the
> >>> > > > ability for the context.lookup() call to work. The reason
> >>> > > > is..I have two
> >>> > > > computers, networked. I want to develop the ejbs on one
> >>> > > > computer, and have
> >>> > > > my www stuff on the other hitting them over the network so
> >>> > > > that i can get
> >>> > > > some kind of feel of the performance. I have a 4-way
> >>> > switch, so I can
> >>> > > > develop www stuff, then switch over to the other 
> computer and
> >>> > > > do some ejb
> >>> > > > stuff. I will run one instance of Orion on each computer.
> >>> > > > However, I don't
> >>> > > > mind also being able to run www and ejb stuff in the same on
> >>> > > > instance on one
> >>> > > > computer, as long as the lookup stuff is used the same way,
> >>> > > > even though the
> >>> > > > ejb's are running locally.
> >>> > > >
> >>> > > > Any pointers on how to set up Orion to do this, 
> including the
> >>> > > > application.xml <module> tag (how to point it to the right
> >>> > > > place instead of
> >>> > > > the ejb.jar file, for example so that the ejbs will get
> >>> > > > picked up by the
> >>> > > > server), web.xml, orion-web.xml, server.xml, etc..anything
> >>> > > > that needs to be
> >>> > > > done to get this to work.
> >>> > > >
> >>> > > > Thanks so much for any help.
> >>> > > >
> >>> > > >
> >>> > >
> >>> >
> >>>
> >>
> >
> >
> >
> >
> >
> >
> 
> 

Reply via email to