Package org.exist.storage.txn

Examples of org.exist.storage.txn.TransactionManager.commit()


      final Txn transaction = tm.beginTransaction();
     
      try {
        final Collection child = broker.getOrCreateCollection(transaction, uri.toCollectionPathURI());
        broker.saveCollection(transaction, child);
        tm.commit(transaction);
      } catch (final Exception e) {
          tm.abort(transaction);
        return false;
      } finally {
                tm.close(transaction);
View Full Code Here


             
              newName = destinationPath.lastSegment();
 
              transaction = tm.beginTransaction();
              broker.moveResource(transaction, doc, destination, newName);
              tm.commit(transaction);
              return true;
             
          } catch ( final Exception e ) {
            e.printStackTrace();
            if (transaction != null) {tm.abort(transaction);}
View Full Code Here

//                resource = null;
//                collection = null;
//                initialized = false;
//                uri = ((Resource)dest).uri;

                tm.commit(transaction);
                return true;
               
            } catch ( final Exception e ) {
                e.printStackTrace();
                if (transaction != null) {tm.abort(transaction);}
View Full Code Here

//          info.getDocument().getMetadata().setMimeType(mimeType.getName());
 
          is = new FileInputSource(file);
          collection.store(txn, broker, info, is, false);

            tm.commit(txn);
           
        } catch ( final Exception e ) {
            e.printStackTrace();
            if (txn != null) {tm.abort(txn);}
      } finally {
View Full Code Here

              if(doc.getResourceType() == DocumentImpl.BINARY_FILE)
                  {collection.removeBinaryResource(txn, broker, doc);}
              else
                  {collection.removeXMLResource(txn, broker, uri.lastSegment());}
             
              tm.commit(txn);
              return true;
 
          } catch (final Exception e) {
            if (txn != null) {tm.abort(txn);}
              return false;
View Full Code Here

          collection.addBinaryResource(transaction, broker, blob, is,
              mimeType.getName(), 0L , new Date(), new Date());
 
        }
        tm.commit(transaction);
      } catch (final Exception e) {
        tm.abort(transaction);
        throw new IOException(e);
      } finally {
                tm.close(transaction);
View Full Code Here

            txn = tm.beginTransaction();

            method.modify(collection);
            broker.saveCollection(txn, collection);
           
            tm.commit(txn);

          } else {
            collection = resource.getCollection();

            txn = tm.beginTransaction();
View Full Code Here

            txn = tm.beginTransaction();
           
            method.modify(resource);
                  broker.storeMetadata(txn, resource);
           
            tm.commit(txn);
          }
        }
      } catch (final IOException e) {
        if (txn != null) {
          tm.abort(txn);
View Full Code Here

                    col.store(txn, broker, info, new InputSource(is), false);
                } finally {
                    is.close();
                }

                txManager.commit(txn);
            } else {
                txn = txManager.beginTransaction();
   
                FileInputStream is = new FileInputStream(file);
                try {
View Full Code Here

                            MimeType.BINARY_TYPE.getName(), file.length());
                } finally {
                    is.close();
                }
   
                txManager.commit(txn);
            }
        } catch (Exception e) {
            if (txn != null) {
                txManager.abort(txn);
            }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.