• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

The most suitable EJB for the senario

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Part of an application's business logic is implemented using a limited set of connections to a legacy system. The development team want to provide an EJB interface to this legacy code. The BEST approach to managing connection resources would be to use BMP Entity Bean?
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No absolutely not. A BMP is the WRONG approach for this. The problem is that BMP's (and CMP's) make several assumptions about the underlying datastore -- primary among which is the assumption that there is a single "primary key" for each BMP instance. (Thus findByPrimaryKey() and the entire caching mechanism that hinges on that).
Well, most legacy systems don't act like relational databases. Instead, if you are using something like a CICS system, it acts much more like a collection of function calls (each transaction is a function). We have found that a Session bean is a much more natural representation for a legacy system in this case.
Kyle
 
Ranch Hand
Posts: 107
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Roland or Kyle, I have a seperate post for this question but since you are on this topic I thought I would ask here as well. Could you please explain your approach in connecting ejb's to a legacy system. We have several tcp/ip connected systems and are replacing the middleware routing with an application server. What is the best approach in connecting to existing tcp/ip oriented applications.
Thanks.
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Personally, I prefer the Session bean approach where a Session Facade (ala "Core J2EE Patterns") wraps a special layer of helper objects that manage your legacy system communication.
Now, that's fairly easy to do. So long as your communication is synchronous it presents no problems (that is you send a request down a socket, turn around and wait for the response, and time out if you don't receive one).
However, asynchrounous communication is more problematic. There you have to do some nasty tricks like for instance implementing "bridges" between an asynchronous listener on your socket and a JMS queue (listen on the socket, when you get a request, pop it on a queue and then have an MDB waiting on that queue). Another trick is to simply put the asynchronous listener in the Servlet engine (web container) rather than in the EJB container.
However, your best bet is to see if it's at all possible to lose the existing TCP/IP infrastructure and see if you can't move to something like JCA. There are now JCA connectors for a number of different types of system -- the days of people writing their own middleware layers are numbered. One thing I would NOT recommend, btw, is trying to write your own JCA layer on top of an existing structure -- writing JCA connectors is a tricky business best left to vendors if at all possible.
Kyle
[ March 26, 2002: Message edited by: Kyle Brown ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic