jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kazim_ssuet@yahoo.com" <kazim_ss...@yahoo.com>
Subject Re: Extend OraclePersistenceManager
Date Fri, 19 Nov 2010 20:23:27 GMT

Firstly I did not need to extend
"org.apache.jackrabbit.core.persistence.pool.OraclePersistenceManager",
since I was using
"org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager" as
persistance manager.

So now i am only extending
"org.apache.jackrabbit.core.persistence.bundle.OraclePersistenceManager" as
follows. Note that there are modifications in code compared to previous
post.

public class CsiOraclePersistenceManager extends OraclePersistenceManager 
{
	private static Logger log =
LoggerFactory.getLogger(OraclePersistenceManager.class);
	
	protected synchronized void storeBundle(NodePropBundle bundle) throws
ItemStateException 
	{
		log.info("Before calling OraclePersistenceManager.storeBundle");
		super.storeBundle(bundle);
		log.info("After calling OraclePersistenceManager.storeBundle");
		log.info("Before calling postStoreBundle");
		postStoreBundle(bundle);
		log.info("After calling postStoreBundle");	
	}
	
	private void postStoreBundle(NodePropBundle bundle)
	{
		try
		{
			log.info("In postStoreBundle");

			boolean isNew = bundle.isNew();
			log.info("Is New: " + isNew);

			Name nodeTypeName = bundle.getNodeTypeName();
			String nodeTypeLocalName = nodeTypeName.getLocalName();
			String nodeTypeNamespace = nodeTypeName.getNamespaceURI();
			log.info("Node Type Local Name: " + nodeTypeName.getLocalName());
			log.info("Node Type Namespace URI: " + nodeTypeName.getNamespaceURI());
			
			// All is fine uptill here.
			
			// As soon as I add "bundle.getPropertyNames()" below, I get
"javax.jcr.RepositoryException: Unable to update item: node /" in my client
program
			Set propertyNames = bundle.getPropertyNames();			
		}
		catch(Exception e)
		{
			e.printStackTrace();
		}
	}

}

Everything is fine untill I add "bundle.getPropertyNames()" in above code, I
see all log messaes in websphere log.
As soon as I add "bundle.getPropertyNames()" I see no log messages added in
"postStoreBundle" method, as if "postStoreBundle" was never called.

and exception trace at client code (using RMI) is:

Exception in thread "main" javax.jcr.RepositoryException: Unable to update
item: node / 
        at
org.apache.jackrabbit.rmi.server.ServerObject.getRepositoryException(ServerObject.java:145)

        at
org.apache.jackrabbit.rmi.server.ServerSession.save(ServerSession.java:265) 
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:79) 
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
        at java.lang.reflect.Method.invoke(Method.java:618) 
        at
sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:309) 
        at sun.rmi.transport.Transport$1.run(Transport.java:168) 
        at
java.security.AccessController.doPrivileged(AccessController.java:279) 
        at sun.rmi.transport.Transport.serviceCall(Transport.java:164) 
        at
sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:506) 
        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.handleRequest(TCPTransport.java:838)

        at
sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:912) 
        at java.lang.Thread.run(Thread.java:810) 
        at
sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(Unknown
Source) 
        at sun.rmi.transport.StreamRemoteCall.executeCall(Unknown Source) 
        at sun.rmi.server.UnicastRef.invoke(Unknown Source) 
        at
org.apache.jackrabbit.rmi.server.ServerXASession_Stub.save(Unknown Source) 
        at
org.apache.jackrabbit.rmi.client.ClientSession.save(ClientSession.java:272) 
        at JackrabbitTest.addContent(JackrabbitTest.java:979) 
        at JackrabbitTest.addContent(JackrabbitTest.java:780) 
        at JackrabbitTest.main(JackrabbitTest.java:188) 

Please help.

Thanks,
KS.


-- 
View this message in context: http://jackrabbit.510166.n4.nabble.com/Extend-OraclePersistenceManager-tp3050526p3050929.html
Sent from the Jackrabbit - Dev mailing list archive at Nabble.com.

Mime
View raw message