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.addNode("child");
node.getSession().save();
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
Dominique
On 6/1/07, Frédéric Esnault <[EMAIL PROTECTED]> 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