示例#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);
   }
 }
示例#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);
   }
 }
示例#3
0
 @Override
 public void close() throws RepositoryException {
   try {
     super.close();
   } finally {
     cachedObjects.clear();
   }
 }
示例#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();
 }