Re: EJB & Cayenne transactional behavior

From: Andrus (andru..bjectstyle.org)
Date: Sun Apr 28 2002 - 21:52:54 EDT

  • Next message: Michael Shengaout: "Re: EJB & Cayenne transactional behavior"

    Hi Johnny,

    At 05:42 PM 4/28/2002 -0700, Johnny Ren wrote:
    >Hi,
    >
    >I am new to Cayenne project. I will be very likely to
    >join your project two weeks from now after I finish my
    >SUN certified java programmer test.

    Good luck with that :-).

    >I do have some questions regarding the transactional
    >behavior topic.
    >
    >1: the topic itself
    > > "Transactional behavior of Cayenne when used for
    > > data persistence in
    > > Stateful Session Beans".
    >
    >Why do you only mention Stateful Session Beans ? Do
    >you plan to use different strategy for Stateless
    >Session Beans, Stateful Session Beans and BMP ?
    >
    >It seems to me that only one strategy should be used
    >for those beans.

    I think Cayenne is not an efficient tool to be used in Entity beans for
    BMP. It would require a set of Cayenne access and map classes (DataNode,
    DataMap, entities) to be created within every bean instance. Looks like
    lots of overhead. Unless we find a way to make a single "Cayenne instance"
    to be shared between all the entity beans, I don't think it is feasible. I
    am open to suggestions though.

    I was concentrating on beans that can implement SessionSynchronization
    interface, since it provides hooks for Cayenne to save data or undo
    changes. In fact Cayenne architecture maps rather well to that. Note that
    only *stateful session* beans can implement this interface. Therefore this
    specific discussion.

    >2: transaction attributes
    > > by the container. Furthermore there are 3 types of
    > > EJB transaction
    > > attributes:
    >
    >The attributes you mentioned are CMP attribute. They
    >are not applied to Session beans and BMP.

    I am no big EJB expert, but I think you are wrong on that. These attributes
    are specified in deployment descriptor of any kind of bean and are applied
    by bean business method.

    As for my questions they were not about CMP like behavior. I don't see how
    we can help with BMP of Entity beans in any reasonable way (again unless
    there is a way to use shared instance of Cayenne from beans and not via a
    remote call, but rather locally). I suggest to concentrate on persistence
    in workflow EJBs.

    As for real CMP, we are planning to use Cayenne as an O/R plugin for an EJB
    server (JBoss for instance). This would be a very cool deployment scenario
    and would make Cayenne a much more used tool (even though I hate EJB as
    technology, a good CMP may make it bearable :-)). But this feature is not
    on our immediate schedule yet (unless there is a volunteer to pick it up ;-)).

    Andrus



    This archive was generated by hypermail 2.0.0 : Sun Apr 28 2002 - 21:52:32 EDT