Example #1
0
 @Override
 public synchronized void setAutoCommit(boolean auto) throws RepositoryException {
   if (!auto && isAutoCommit()) {
     try {
       try {
         if (blobVersion != null) {
           try {
             blobVersion.prepare();
           } catch (IOException exc) {
             throw new BlobConflictException(exc);
           }
         }
         super.setAutoCommit(auto);
         if (blobVersion != null) {
           blobVersion.commit();
           blobVersion = null;
         }
       } finally {
         if (blobVersion != null) {
           blobVersion.rollback();
           blobVersion = null;
         }
       }
     } catch (IOException e) {
       throw new BlobStoreException(e);
     }
   } else {
     super.setAutoCommit(auto);
   }
 }
Example #2
0
 @Override
 public synchronized void commit() throws RepositoryException {
   try {
     try {
       if (blobVersion != null) {
         try {
           blobVersion.prepare();
         } catch (IOException exc) {
           throw new BlobConflictException(exc);
         }
       }
       super.commit();
       if (blobVersion != null) {
         blobVersion.commit();
         blobVersion = null;
       }
     } finally {
       if (blobVersion != null) {
         blobVersion.rollback();
       }
     }
   } catch (IOException e) {
     throw new BlobStoreException(e);
   }
 }
Example #3
0
 @Override
 public void close() throws RepositoryException {
   try {
     super.close();
   } finally {
     cachedObjects.clear();
   }
 }
Example #4
0
 @Override
 public synchronized void rollback() throws RepositoryException {
   if (blobVersion != null) {
     try {
       blobVersion.rollback();
     } catch (IOException e) {
       throw new RepositoryException(e.toString(), e);
     }
   }
   super.rollback();
   cachedObjects.clear();
 }