Originally posted by Renat Zubairov:
stole data
... what does "stole data" mean?
... updatable value object ... and under the object complex data tree is stored (agregated). In this case if we are trying to add a new data to VO and we need transactional support for it, we can't do it in VO.
Why can we not add new data to the VO if we need transactional support? I agree that we need additional effort for container managed relationships (CMR, not CMT) for mapping the new VO data to a newly found, newly created or given entity bean, but this does not concern CMT. Right?
... if we need complex transactional behaviour for Entity beans method (... imagine User.addSubscription() or User.addItinerary() ) we are stuck with the CMT.
We were talking about stateLESS SessionBeans/Facades, therefore the CMT transaction normally will not last longer than the one call to one method of that stateless SessionBean anyway, right?
But within that one call a whole workflow of multiple EntityBean-calls may use that same transaction started by the SessionBean.
So as long as we do not need a transaction spanning several sessions (request/response pairs): Why are we stuck with CMT (container managed transactions) for things like User.addItinerary()? We must use CMT wherever we use EntityBeans, because EntityBeans are supported by CMT only. Is it that what you ment?
More important: Is it wise to add things like Itinerary to a User VO that probabely is not needed for web clients? Should we not prefere something like a Response VO carrying a User Object, if needed, and an Itinerary (etc.) object with it (for Java and for web clients)?
- - -
BTW: I guess that most containers will automatically begin a [flat] transaction when accessing a SeesionBeans's method having a "Requires" or "RequiredNew" transaction attribute. What I am not sure by myself is: How could we tell the container to use the same transaction for multiple request/response pairs when using CMT? It would not make much sense, I know, but is that possible at all when using CMT?