Christian,
It
will make your life more complex, because it sounds like some of your business
methods are built into the stored procedures (before j2ee, this was why we used
stored procedures!).
All in
all, the cost of qa/qc on a new data model should be weighed against the cost of
maitenance for the old data-model in the future. Here are steps for a quick
and dirty integration with j2ee:
1.
create cmp's with the same datafields as your datastore.
2. if
store procedures are used to create rows, then use a slsb to do this. You can
embed the slsb within your cmp, or not. Typically, slsb's are used as
facades for specific jdbc/sql actions. Essentially, the same stored
procedures are used.
3. Use
a slsb as a facade/controllor for all cmp access. Thus business methods which
use stored procedures can be used, and if the business methods is in the cmp,
then the cmp business method can be used.
4.
Modify your cmp finders in your cmp to match the efficiency of the original
pl/sql queries...easily done in Orion with the
orion-ejb-jar.xml.
Over
time, you can drop store procedures as your qc verifies the accuracy of business
methods in the slsb or cmp.
With
this approach you can achieve integration with j2ee quickly and the design
allows you to migrate to a total j2ee solution in the future. Also, your j2ee
client/web front will not have to change as the underlying data-structure is
migrated from stored procedures to j2ee.
regards,
the
elephantwalker
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Cristian Donciulescu
Sent: Thursday, September 06, 2001 6:38 AM
To: Orion-Interest
Subject: RE: Stored procedures and J2EE>From: "The elephantwalker" <[EMAIL PROTECTED]> >Reply-To: Orion-Interest <[EMAIL PROTECTED]> >To: Orion-Interest <[EMAIL PROTECTED]> >Subject: RE: Stored procedures and J2EE >Date: Thu, 6 Sep 2001 02:23:29 -0700 > >A bean is just a representation of data in a datastore with a collection of >finder and business methods. You can use cmp's to access data which is >already in a datastore. > >A stateless session bean can be used to fire off your create procedures, and >this slsb can be in your cmp create (or not, for that matter). > >As for distributing your business logic between the datastore and middle >tier...aren't you making your life more complex than it needs to be? There >is absolutely no hit on performance if you pull out all of your business >logic into a slsb or cmp...there's just no need to use store procedures any >more. > >If you are doing this to filter your output or because you need custom >joins, etc. there are much easier ways to do this...such as using a custom >finder method in orion (its a five minute job in the orion-ejb-jar.xml file) >or a slsb. > >regards, > >the elephantwalker > > -----Original Message----- > From: [EMAIL PROTECTED] >[mailto:[EMAIL PROTECTED]]On Behalf Of Cristian >Donciulescu > Sent: Thursday, September 06, 2001 1:41 AM > To: Orion-Interest > Subject: Stored procedures and J2EE > > > Is it possible (and recommended) to use stored procedures with the J2EE >architecture? We would be interested in creating objects directly into the >database, bypassing the create method of the enterprise bean. Is this >possible when using CMP (Container Managed Persistence)? If not, in your >opinion, which is best: using BMP and stored procedures or using CMP? > > > > Example: We have an Oracle DB that uses packages associated to the >business objects of the system. These packages contain the PL/SQL methods of >the corresponding business objects. Additionally every business object’s >fields are stored as columns of a specific table. The constructor of a >business object is also a method in the associated package. The inheritance >relation between two objects is modeled by making the primary key of the >child object’s table reference the primary key field of the parent object’s >table. This reference means that the child inherits the fields of the >parent. Thus, the constructor of a child object, which is passed all the >parameters required for itself and its parent’s initialization, will call >the constructor of its parent passing the appropriate parameters. The >question is: > > > > How could such constructors be used without conflicting with the create >methods of the CMP entity beans? > > >---------------------------------------------------------------------------- >-- > Get your FREE download of MSN Explorer at http://explorer.msn.com >Thanks for your help. The reason I want to use stored procedures it that we want to make use of a datamodel that we already have. This data-model uses stored procedures intensively. What would you suggest? Keep the data model as is and adapt the J2EE code to it or change the data-model so that we don't use the stored procedures that much?
Christian
Get your FREE download of MSN Explorer at http://explorer.msn.com
