jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Pfister" <dominique.pfis...@day.com>
Subject Re: XASession and hasPendingChanges
Date Fri, 01 Jun 2007 13:17:08 GMT
Hi Frédéric,

according to the specification, hasPendingChanges should return true
if the session has unsaved changes. Some operations (e.g.
javax.jcr.Node.merge(String, boolean)) rely on a session not having
any pending changes. Some client could perfectly use code such as

node.merge("sourcews", true);

If an XASessionImpl has saved but uncommitted changes - this is
probably the case you're referring to, isn't it? - it could decide to
return true in its hasPendingChanges implementation. However, the same
client, unaware of the transactional nature of its session, would
never be able to execute the same piece of code shown above, because
the session would still report pending changes. In other words, a
client would have to detect whether or not it runs in a transactional
environment, which is probably not what you want.

Kind regards

On 6/1/07, Frédéric Esnault <fesn@legisway.com> wrote:
> I have a question about the transactional version of the SessionImpl object.
> It inherits the hasPendingChanges from the SessionImpl class, but my question is :
> Shouldn't the  hasPendingChanges from XASessionImpl take into consideration the tx status?
> Or am I missing something?
> Frederic Esnault

View raw message