jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pkrishnaswami <prabhakar.krishnasw...@ge.com>
Subject Problems re-saving content after Rollback
Date Mon, 16 Nov 2009 17:29:20 GMT

We are wrapping JackRabbit APIs within a transaction and we have run into an
issue after a rollback. Here is the scenario:

Step I:

We call publishItem with a good content; publishItem is  transactional and
contains 3 other calls, 2 of them goes against the JackRabbit repository and
third against oracle.  This call first calls saveItem using JCR 170 apis; as
part of packaging, we call retrieveContentItem which underneath does node
traversal to retrieve the saved content and later we do a save of the
content item to the oracle database.The publish completes successfully; BTW,
the saveItem creates new versions of the content item since this node is
versionable. Here are steps our code goes through in the process of saving a
new content item:

session.save()
(Node representing the content item)node.checkout();
update some metadata attributes on the custom node we have created
node.save();
node.checkin();
session.save()

Here are steps our code goes through in the process of saving a new version
of a content item:

node.checkout();
update some metadata attributes on the custom node we have created
node.save();
node.checkin();
session.save()




Step II:
We again call publishItem with a bad content and a good content(This is the
item in step I but we are creating a new version). After saveItem phase, we
do a node traversal to retrieve the items. During retrievel of the bad
content, and exception is thrown and the transaction is rolled back. BTW,
the roll back happens automatically and is handled through the transaction
manager.

Step III:
We again try to call publishItem with good content. But this time, the
saveItem fails and we get an exception where the exception message is
"'Failed to create version {}1.2.". The actual stack trace on the server is
as below:

Caused by: javax.jcr.RepositoryException:
e396d94e-8aa9-4c0a-b6d7-a80f7bf7270a: e396d94e-8aa9-4c0a-b6d7-a80f7bf7270a
        at
org.apache.jackrabbit.core.version.NodeStateEx.store(NodeStateEx.java:500)
        at
org.apache.jackrabbit.core.version.AbstractVersionManager.getParentNode(AbstractVersionManager.java:362)
        at
org.apache.jackrabbit.core.version.AbstractVersionManager.createVersionHistory(AbstractVersionManager.java:305)
        at
org.apache.jackrabbit.core.version.XAVersionManager.createVersionHistory(XAVersionManager.java:147)
        at
org.apache.jackrabbit.core.version.AbstractVersionManager.getVersionHistory(AbstractVersionManager.java:234)
        at
org.apache.jackrabbit.core.ItemImpl.initVersionHistories(ItemImpl.java:729)
        at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1082)
        at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:846)
        at
com.gehc.ce.content.rar.SessionHandle.save(SessionHandle.java:239)
        at
com.gehc.ce.content.persistence.dao.impl.JackRabbitContentRepositoryDaoImpl.processNewVariant(JackRabbitContentRepositoryDaoImpl.java:804)
        at
com.gehc.ce.content.persistence.dao.impl.JackRabbitContentRepositoryDaoImpl.saveContentItem(JackRabbitContentRepositoryDaoImpl.java:674)
        ... 48 more
Caused by: org.apache.jackrabbit.core.state.NoSuchItemStateException:
e396d94e-8aa9-4c0a-b6d7-a80f7bf7270a
        at
org.apache.jackrabbit.core.state.SharedItemStateManager.getItemState(SharedItemStateManager.java:270)
        at
org.apache.jackrabbit.core.state.LocalItemStateManager.getNodeState(LocalItemStateManager.java:93)
        at
org.apache.jackrabbit.core.state.LocalItemStateManager.getItemState(LocalItemStateManager.java:158)
        at
org.apache.jackrabbit.core.state.XAItemStateManager.getItemState(XAItemStateManager.java:253)
        at
org.apache.jackrabbit.core.version.NodeStateEx.store(NodeStateEx.java:528)


At this point, we think that the indexes are being rolled back. Is this
right? Any insight will be helpful
-- 
View this message in context: http://n4.nabble.com/Problems-re-saving-content-after-Rollback-tp622259p622259.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
View raw message