jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "shahid.khan" <shahi...@gmail.com>
Subject Always getting exception:Session has pending changes
Date Wed, 15 Sep 2010 09:11:08 GMT

Hi All, 

I am facing problem when doing checkin after a checkout of "mix:versionable"
node. I am getting following exception at the time of checkin: 
InvalidItemStateException: Unable to perform operation. Session has pending
changes. 
        at
org.apache.jackrabbit.core.ItemValidator.checkCondition(ItemValidator.java:296) 
        at
org.apache.jackrabbit.core.ItemValidator.checkModify(ItemValidator.java:277) 
        at
org.apache.jackrabbit.core.VersionManagerImpl.getNodeState(VersionManagerImpl.java:520) 
        at
org.apache.jackrabbit.core.VersionManagerImpl.getNodeState(VersionManagerImpl.java:505) 
        at
org.apache.jackrabbit.core.VersionManagerImpl.checkin(VersionManagerImpl.java:102) 
        at
org.apache.jackrabbit.core.VersionManagerImpl.checkin(VersionManagerImpl.java:88) 
        at org.apache.jackrabbit.core.NodeImpl.checkin(NodeImpl.java:3162) 
        at
org.apache.jackrabbit.webdav.simple.DavResourceImpl.addMember(DavResourceImpl.java:581) 
        at
org.apache.jackrabbit.webdav.server.AbstractWebdavServlet.doPut(AbstractWebdavServlet.java:566)


My code is as below: 

            Node fileNode=null; 
            try{ 
            fileNode= node.getNode(ctx.getSystemId()); 
            }catch(PathNotFoundException e){ 
            
            } 
            if(fileNode != null && fileNode.isNodeType("mix:versionable")){ 
            fileNode.checkout(); 
            } 
            if (!config.getIOManager().importContent(ctx, member)) { 
                // any changes should have been reverted in the importer 
                throw new
DavException(DavServletResponse.SC_UNSUPPORTED_MEDIA_TYPE); 
            } 
            // persist changes after successful import 
            if(fileNode != null && fileNode.isNodeType("mix:versionable")){ 
            
            fileNode.checkin(); 
            } 
            Session session=node.getSession(); 
            session.save(); 


I am modifying a files content and if it is versionable node then I am
trying to create a new version but it always says session has pending
changes while I am not performing any changes after checkin. 

Thanks in advance for any help. 

Thanks & Regards 
Shahid K. 

-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/Always-getting-exception-Session-has-pending-changes-tp2540183p2540183.html
Sent from the Jackrabbit - Users mailing list archive at Nabble.com.

Mime
View raw message