Rich Client and other J2EE related Qs

From: Derek Rendall (dere..sure.com)
Date: Tue Jun 29 2004 - 19:24:40 EDT

  • Next message: Jürgen Saar: "Re: Working with Transient Objects"

    Hi

    I am trying to get a handle on an design approach that will satisfy my
    needs - so any feedback would be greatly appreciated. Firstly, some
    background. I am looking at (progressively) replacing a million line J2EE
    Intranet app. I have to cut the number of lines of code drastically in order
    to make things maintainable (we have less resources now than expected), so
    the custom built data layer is a prime candidate. We also need to start
    providing a mix of rich clients and html clients (I suspect more rich
    clients than html, but I want to keep my options open). Our accounting
    module is trigered by events generated by other modules, and if an
    accounting transaction is required, a JMS message is generated in a 2 phase
    commit manner - i.e. the message is only processed IF the surrounding
    transaction is successfully committed. The accounting module then processes
    these messages. This allows us to minimise and effectively manage deadlocks
    in the accounting module without impacting the rest of the business.

    Now for the approach I am thinking of. I would like to use Cayenne (I really
    miss WO/EOF - ahhh the heady days of WO 2.0 ...) and a rich thin client
    product, such as Canoo. Canoo can utilise a servlet or a stateful session
    bean as the server side session manager. I personally prefer the stateful
    session bean approach. Hopefully by using something like Canoo I can avoid
    DTO's being required by a rich client (a rich client directly connecting to
    the DB is NOT an option).

    Questions: (1) Am I right in thinking that life will be simpler if I avoid
    calls to non local session beans as then I can (easily) keep using the same
    DataContext? I read the mailing list entries on using thread-local
    capabilities, but how well would that work when an EJB call is to a bean
    thats NOT in the same VM? It seems a bit dodgy to me, although I will be the
    first to admit that my knowlege of EJBs is not deep enough! I note that
    Hibernate seems to advocate a similar approach to the same sort of issues in
    some of their mailing lists. BTW: Any chance that the sample code mentioned
    in http://objectstyle.org/cayenne/lists/cayenne-user/2004/06/0202.html is
    available yet :-)

    (2) What would be the best way of integrating JMS calls into the same
    transaction as the data storage? I had wondered about the feasibility of a
    JMS Adapter (my accounting module could create the raw "message" objects
    when required by other modules, and do the complex processing on them when
    the jms message comes in). If this is an option, is there even a draft
    version of a non JDBC adapter (e.g. LDAP) I could look at? Alternatively I
    could build up a seperate set of (non-cayenne) objects representing the JMS
    messages and send them after saving the other changes, in the same Container
    managed transaction.

    (3) What are the issues to be aware of when my session gets
    serialised/deserialised by the container?

    (4) W have our own id generator, and part of its function is to encode
    inheritance heirarchies into the primary key values where necessary. This
    prevents having to do a fetch to find the type of a FK before loading the
    FK - does Cayenne do the double fetch approach, and if so, is there a way to
    make use of the encoding in the ids (someone I knew did this in EOF several
    years back). Note: we have the type field as well (for non FK lookup queries
    etc).

    Thanks for your patience in reading this far!

    Derek



    This archive was generated by hypermail 2.0.0 : Tue Jun 29 2004 - 19:20:22 EDT