Package org.exist.storage.txn

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


 
          final Collection collection = broker.getCollection(uri.toCollectionPathURI());
          if (collection != null) {return true;}
 
      tm = db.getTransactionManager();
      final Txn transaction = tm.beginTransaction();
     
      try {
        final Collection child = broker.getOrCreateCollection(transaction, uri.toCollectionPathURI());
        broker.saveCollection(transaction, child);
        tm.commit(transaction);
View Full Code Here


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

                    return false;
                }
               
                newName = destinationPath.lastSegment();
   
                transaction = tm.beginTransaction();
                moveResource(broker, transaction, doc, source, destination, newName);

//                resource = null;
//                collection = null;
//                initialized = false;
View Full Code Here

            } catch (final EXistException e) {
                throw new IOException(e);
            }
   
            tm = db.getTransactionManager();
            txn = tm.beginTransaction();

            FileInputSource is = new FileInputSource(file);
         
            final IndexInfo info = collection.validateXMLResource(txn, broker, uri.lastSegment(), is);
//          info.getDocument().getMetadata().setMimeType(mimeType.getName());
View Full Code Here

              final DocumentImpl doc = collection.getDocument(broker, uri.lastSegment());
              if (doc == null) {
                return true;
              }
             
              txn = tm.beginTransaction();
              if(doc.getResourceType() == DocumentImpl.BINARY_FILE)
                  {collection.removeBinaryResource(txn, broker, doc);}
              else
                  {collection.removeXMLResource(txn, broker, uri.lastSegment());}
             
View Full Code Here

      if (mimeType == null) {
        mimeType = MimeType.BINARY_TYPE;
      }
     
      tm = db.getTransactionManager();
      final Txn transaction = tm.beginTransaction();
 
      InputStream is = null;
      try {
        if (mimeType.isXMLType()) {
          // store as xml resource
View Full Code Here

            collection = broker.getCollection(uri);
            if (collection == null) {
              throw new IOException("Resource not found: "+uri);
            }
           
            txn = tm.beginTransaction();

            method.modify(collection);
            broker.saveCollection(txn, collection);
           
            tm.commit(txn);
View Full Code Here

            tm.commit(txn);

          } else {
            collection = resource.getCollection();

            txn = tm.beginTransaction();
           
            method.modify(resource);
                  broker.storeMetadata(txn, resource);
           
            tm.commit(txn);
View Full Code Here

        TransactionManager txManager = db.getTransactionManager();
        Txn txn = null;
        try {
            MimeType mime = getMimeTable().getContentTypeFor( file.getName() );
            if (mime != null && mime.isXMLType()) {
                txn = txManager.beginTransaction();

                IndexInfo info = col.validateXMLResource(txn, broker,
                        XmldbURI.create(file.getName()),
                        new InputSource(new FileInputStream(file))
                    );
View Full Code Here

                    is.close();
                }

                txManager.commit(txn);
            } else {
                txn = txManager.beginTransaction();
   
                FileInputStream is = new FileInputStream(file);
                try {
                    col.addBinaryResource(txn, broker,
                            XmldbURI.create(file.getName()),
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.