You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jackrabbit.apache.org by mr...@apache.org on 2006/12/05 14:08:54 UTC
svn commit: r482636 -
/jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Author: mreutegg
Date: Tue Dec 5 05:08:53 2006
New Revision: 482636
URL: http://svn.apache.org/viewvc?view=rev&rev=482636
Log:
Work in progress
- Make sure there is a subscription on the server before a batch is submitted. Otherwise observation events for the batch are not accessible anymore.
Modified:
jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
Modified: jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java
URL: http://svn.apache.org/viewvc/jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java?view=diff&rev=482636&r1=482635&r2=482636
==============================================================================
--- jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java (original)
+++ jackrabbit/trunk/contrib/spi/spi2dav/src/main/java/org/apache/jackrabbit/spi2dav/RepositoryServiceImpl.java Tue Dec 5 05:08:53 2006
@@ -145,6 +145,7 @@
import javax.jcr.ValueFactory;
import javax.jcr.LoginException;
import javax.jcr.ReferentialIntegrityException;
+import javax.jcr.Repository;
import javax.jcr.lock.LockException;
import javax.jcr.nodetype.ConstraintViolationException;
import javax.jcr.nodetype.NoSuchNodeTypeException;
@@ -771,6 +772,7 @@
* @see RepositoryService#createBatch(ItemId, SessionInfo)
*/
public Batch createBatch(ItemId itemId, SessionInfo sessionInfo) throws RepositoryException {
+ checkSessionInfo(sessionInfo);
return new BatchImpl(itemId, sessionInfo);
}
@@ -786,7 +788,12 @@
batchImpl.dispose();
return;
}
- // send batched information
+ // make sure we have a subscription on the server before we
+ // submit the batch
+ if (((SessionInfoImpl) batchImpl.sessionInfo).getSubscriptionId() == null
+ && "true".equals(getRepositoryDescriptors().get(Repository.OPTION_OBSERVATION_SUPPORTED))) {
+ getEvents(batchImpl.sessionInfo, 0, new EventFilter[0]);
+ } // send batched information
try {
HttpClient client = batchImpl.start();
boolean success = false;