Re: EJB & Cayenne transactional behavior

From: Michael Shengaout (msheng..obox.com)
Date: Sun Apr 28 2002 - 22:10:58 EDT

  • Next message: Johnny Ren: "Re: EJB & Cayenne transactional behavior"

    I would like to add that the use of the Entity bean is warranted only when
    you need to provide concurrency in update/insert of data. E.g. if you have a
    flight seat, you may want to use Entity bean for holding temprary seat
    reservation, when you book leg1, leg2, leg3, not allowing anyone else book
    those seats while you are holding them, then paying for everything and
    saving to the persistent storage. I haven't seen a single successful project
    using Entity beans as a routine data retrieval and trivial data
    insertion/update mechanism - for that you usually use data objects (like
    Cayenne stuff) either standalone from web container or wrapped in Session
    beans for transactional integrity.

    Misha

    ----- Original Message -----
    From: "Andrus" <andru..bjectstyle.org>
    To: "Johnny Ren" <johnnyre..ahoo.com>; "Cayenne Development"
    <cayenne-deve..bjectstyle.org>
    Sent: Sunday, April 28, 2002 9:52 PM
    Subject: 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 - 22:04:27 EDT