Package org.exist.storage.txn

Examples of org.exist.storage.txn.Txn


    private void store(String name,  String data) throws EXistException {
      Database pool = BrokerPool.getInstance();;
     
        DBBroker broker = null;
        TransactionManager transact = null;
        Txn transaction = null;
        try {
            broker = pool.get(pool.getSecurityManager().getSystemSubject());
            assertNotNull(broker);
            transact = pool.getTransactionManager();
            assertNotNull(transact);
View Full Code Here


                    remove_account.setRemoved(true);
                    remove_account.setCollection(broker, collectionRemovedAccounts, XmldbURI.create(UUIDGenerator.getUUID()+".xml"));

                    final TransactionManager transaction = getDatabase().getTransactionManager();
                    Txn txn = null;
                    try {
                        txn = transaction.beginTransaction();

                        collectionAccounts.removeXMLResource(txn, broker, XmldbURI.create( remove_account.getName() + ".xml"));
View Full Code Here

   
                remove_group.setRemoved(true);
                remove_group.setCollection(broker, collectionRemovedGroups, XmldbURI.create(UUIDGenerator.getUUID() + ".xml"));
   
                final TransactionManager transaction = getDatabase().getTransactionManager();
                Txn txn = null;
                try {
                    txn = transaction.beginTransaction();

                    collectionGroups.removeXMLResource(txn, broker, XmldbURI.create(remove_group.getName() + ".xml" ));
View Full Code Here

//      users = new Int2ObjectHashMap<User>(65);

      this.pool = pool;
     
        final TransactionManager transaction = pool.getTransactionManager();
        Txn txn = null;
   
        Collection systemCollection = null;
        try {
          systemCollection = broker.getCollection(XmldbURI.SYSTEM_COLLECTION_URI);
                if(systemCollection == null) {
View Full Code Here

                    return new SkippedEntryDeferredPermission();
                }
            }

          final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
          final Txn txn = txnManager.beginTransaction();
          try {
            currentCollection = broker.getOrCreateCollection(txn, collUri);
           
            rh.startCollectionRestore(currentCollection, atts);
           
View Full Code Here

            if(currentCollection instanceof Observable) {
                listener.observe((Observable)currentCollection);
            }

      final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
      final Txn txn = txnManager.beginTransaction();
 
      DocumentImpl resource = null;
      try {
        if ("XMLResource".equals(type)) {
          // store as xml resource
View Full Code Here

          try {
            final Collection col = broker.getCollection(currentCollection.getURI().append(name));
            if(col != null) {
              //delete
              final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
              final Txn txn = txnManager.beginTransaction();
              try {
                    broker.removeCollection(txn, col);
                txnManager.commit(txn);
              } catch (final Exception e) {
                txnManager.abort(txn);
               
                    listener.warn("Failed to remove deleted collection: " + name + ": " + e.getMessage());
          } finally {
                        txnManager.close(txn);
                    }
            }
          } catch (final Exception e) {
                listener.warn("Failed to remove deleted collection: " + name + ": " + e.getMessage());
      }

        } else if("resource".equals(type)) {

          try {
            final XmldbURI uri = XmldbURI.create(name);
            final DocumentImpl doc = currentCollection.getDocument(broker, uri);
           
            if (doc != null) {
              final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
              final Txn txn = txnManager.beginTransaction();
                try {
                 
                  if (doc.getResourceType() == DocumentImpl.BINARY_FILE) {
                      currentCollection.removeBinaryResource(txn, broker, uri);
                  } else {
View Full Code Here

    }
   
    private Collection mkcol(XmldbURI collPath, Date created) throws SAXException {
       
      final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
      final Txn txn = txnManager.beginTransaction();
      try {
        final Collection col = broker.getOrCreateCollection(txn, collPath);
       
        txnManager.commit(txn);
       
View Full Code Here

        public void apply() {
            try {
              getTarget().getLock().acquire(Lock.WRITE_LOCK);

                final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
                final Txn txn = txnManager.beginTransaction();
              try {
                    final Permission permission = getTarget().getPermissions();
                  permission.setOwner(getOwner());
                  permission.setGroup(getGroup());
                  permission.setMode(getMode());
View Full Code Here

        public void apply() {
            try {
              getTarget().getUpdateLock().acquire(Lock.WRITE_LOCK);

              final TransactionManager txnManager = broker.getDatabase().getTransactionManager();
                final Txn txn = txnManager.beginTransaction();

              try {
               
                final Permission permission = getTarget().getPermissions();
                  permission.setOwner(getOwner());
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.