Package org.exist.storage.txn

Examples of org.exist.storage.txn.Txn


     * @see org.w3c.dom.Node#appendChild(org.w3c.dom.Node)
     */
    @Override
    public Node appendChild(Node child) throws DOMException {
        final TransactionManager transact = ownerDocument.getBrokerPool().getTransactionManager();
        final Txn transaction = transact.beginTransaction();
        final NodeListImpl nl = new NodeListImpl();
        nl.add(child);
        DBBroker broker = null;
        try {
            broker = ownerDocument.getBrokerPool().get(null);
View Full Code Here


        if (!(refChild instanceof StoredNode))
            {throw new DOMException(DOMException.WRONG_DOCUMENT_ERR, "Wrong node type");}
        final NodeListImpl nl = new NodeListImpl();
        nl.add(newChild);
        final TransactionManager transact = ownerDocument.getBrokerPool().getTransactionManager();
        final Txn transaction = transact.beginTransaction();
        DBBroker broker = null;
        try {
            broker = ownerDocument.getBrokerPool().get(null);
            insertBefore(transaction, nl, refChild);
            broker.storeXMLResource(transaction, (DocumentImpl) getOwnerDocument());
View Full Code Here

            } catch (final Exception e) {
                throw new PackageException("Bad collection URI for <target> element: " + targetPath);
            }
        }
        final TransactionManager mgr = broker.getBrokerPool().getTransactionManager();
        final Txn txn = mgr.beginTransaction();
        try {
            Collection collection = broker.getOrCreateCollection(txn, targetCollection);
            if (collection != null)
                {broker.removeCollection(txn, collection);}
            if (target != null) {
View Full Code Here

        }
        builder.endDocument();
        final DocumentImpl updatedXML = builder.getDocument();

        final TransactionManager mgr = broker.getBrokerPool().getTransactionManager();
        final Txn txn = mgr.beginTransaction();
        try {
            final Collection collection = broker.getOrCreateCollection(txn, targetCollection);
            final XmldbURI name = XmldbURI.createInternal("repo.xml");
            final IndexInfo info = collection.validateXMLResource(txn, broker, name, updatedXML);
            final Permission permission = info.getDocument().getPermissions();
View Full Code Here

     * @param directory
     * @param target
     */
    private void scanDirectory(File directory, XmldbURI target, boolean inRootDir) {
        final TransactionManager mgr = broker.getBrokerPool().getTransactionManager();
        final Txn txn = mgr.beginTransaction();
        Collection collection = null;
        try {
            collection = broker.getOrCreateCollection(txn, target);
            setPermissions(true, null, collection.getPermissionsNoLock());
            broker.saveCollection(txn, collection);
View Full Code Here

                MimeType mime = mimeTab.getContentTypeFor(file.getName());
                if (mime == null)
                    {mime = MimeType.BINARY_TYPE;}
                final XmldbURI name = XmldbURI.create(file.getName());

                final Txn txn = mgr.beginTransaction();
                try {
                    if (mime.isXMLType()) {
                        final InputSource is = new InputSource(file.toURI().toASCIIString());
                        final IndexInfo info = targetCollection.validateXMLResource(txn, broker, name, is);
                        info.getDocument().getMetadata().setMimeType(mime.getName());
View Full Code Here

  }

  @Override
  public void start(DBBroker broker) throws EXistException {
        final TransactionManager transaction = db.getTransactionManager();
        Txn txn = null;

        try {
          collection = broker.getCollection(COLLETION_URI);
      if (collection == null) {
        txn = transaction.beginTransaction();
View Full Code Here

 
          final Collection parent_collection = broker.getCollection(uri.toCollectionPathURI().removeLastSegment());
          if (parent_collection == null) {return false;}
 
          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

 
          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

      } catch (final EXistException e) {
        return false;
      }
 
      tm = db.getTransactionManager();
      Txn transaction = null;
 
          org.exist.collections.Collection destination = null;
          org.exist.collections.Collection source = null;
          XmldbURI newName;
      try {
View Full Code Here

TOP

Related Classes of org.exist.storage.txn.Txn

Copyright © 2018 www.massapicom. 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.