Examples of registerLock()


Examples of org.exist.storage.txn.Txn.registerLock()

                perm.setMode(permissions);
                if (owner != null) {
                    perm.setOwner(owner);
                    perm.setGroup(ownerGroup);
                }
                transaction.registerLock(collection.getLock(), Lock.WRITE_LOCK);
                broker.saveCollection(transaction, collection);
                transact.commit(transaction);
                broker.flush();
                return;
            }
View Full Code Here

Examples of org.exist.storage.txn.Txn.registerLock()

            temp.addDocument(transaction, this, targetDoc); //NULL transaction, so temporary fragment is not journalled - AR
            // unlock the temp collection
            if(transaction == null) {
                temp.getLock().release(Lock.WRITE_LOCK);
            } else if(!created) {
                transaction.registerLock(temp.getLock(), Lock.WRITE_LOCK);
            }
            //NULL transaction, so temporary fragment is not journalled - AR
            storeXMLResource(transaction, targetDoc);
            flush();
            closeDocument();
View Full Code Here

Examples of org.exist.storage.txn.Txn.registerLock()

            assertNotNull(transaction);
            System.out.println("Transaction started ...");
           
            Collection root = broker.openCollection(TestConstants.TEST_COLLECTION_URI, Lock.WRITE_LOCK);
            assertNotNull(root);
            transaction.registerLock(root.getLock(), Lock.WRITE_LOCK);           
            broker.removeCollection(transaction, root);
           
            transact.commit(transaction);
            System.out.println("Transaction commited ...");
      } catch (Exception e) {        
View Full Code Here

Examples of org.exist.storage.txn.Txn.registerLock()

            assertNotNull(transaction);
            System.out.println("Transaction started ...");

            Collection root = broker.openCollection(TestConstants.TEST_COLLECTION_URI, Lock.WRITE_LOCK);
            assertNotNull(root);
            transaction.registerLock(root.getLock(), Lock.WRITE_LOCK);
            broker.removeCollection(transaction, root);

            transact.commit(transaction);
            System.out.println("Transaction commited ...");
      } catch (Exception e) {
View Full Code Here

Examples of org.exist.storage.txn.Txn.registerLock()

            assertNotNull(transaction);
            System.out.println("Transaction started ...");

            Collection root = broker.openCollection(TestConstants.TEST_COLLECTION_URI, Lock.WRITE_LOCK);
            assertNotNull(root);
            transaction.registerLock(root.getLock(), Lock.WRITE_LOCK);
            broker.removeCollection(transaction, root);

            transact.commit(transaction);
            System.out.println("Transaction commited ...");
      } catch (Exception e) {
View Full Code Here

Examples of org.exist.storage.txn.Txn.registerLock()

            if (collection == null) {
              transact.abort(transaction);
                throw new EXistException("Collection " + docUri.removeLastSegment() + " not found");
            }
            // keep the write lock in the transaction
            transaction.registerLock(collection.getLock(), Lock.WRITE_LOCK);
            if (overwrite == 0) {
                final DocumentImpl old = collection.getDocument(broker, docUri.lastSegment());
                if (old != null) {
                  transact.abort(transaction);
                    throw new PermissionDeniedException("Old document exists and overwrite is not allowed");
View Full Code Here

Examples of org.exist.storage.txn.Txn.registerLock()

            if (collection == null) {
                transact.abort(transaction);
                throw new EXistException("Collection " + docUri.removeLastSegment() + " not found");
            }
            // keep the write lock in the transaction
            transaction.registerLock(collection.getLock(), Lock.WRITE_LOCK);

            final DocumentImpl doc = collection.getDocument(broker, docUri.lastSegment());
            if (doc == null) {
                transact.abort(transaction);
                throw new EXistException("Document " + docUri + " not found");
View Full Code Here

Examples of org.exist.storage.txn.Txn.registerLock()

            if (collection == null) {
              transact.abort(transaction);
                return false;
            }
            // keep the write lock in the transaction
            transaction.registerLock(collection.getLock(), Lock.WRITE_LOCK);
            LOG.debug("removing collection " + collURI);
            final boolean removed = broker.removeCollection(transaction, collection);
            transact.commit(transaction);
            return removed;
View Full Code Here

Examples of org.exist.storage.txn.Txn.registerLock()

            assertNotNull(transaction);
            System.out.println("Transaction started ...");

            Collection root = broker.openCollection(TestConstants.TEST_COLLECTION_URI, Lock.WRITE_LOCK);
            assertNotNull(root);
            transaction.registerLock(root.getLock(), Lock.WRITE_LOCK);
            broker.removeCollection(transaction, root);
            transact.getJournal().flushToLog(true);
            transact.commit(transaction);
            System.out.println("Transaction commited ...");
        } catch (Exception e) {
View Full Code Here

Examples of org.exist.storage.txn.Txn.registerLock()

            assertNotNull(transaction);
            System.out.println("Transaction started ...");
           
            Collection root = broker.openCollection(TestConstants.TEST_COLLECTION_URI, Lock.WRITE_LOCK);
            assertNotNull(root);
            transaction.registerLock(root.getLock(), Lock.WRITE_LOCK);           
            broker.removeCollection(transaction, root);  
           
            transact.commit(transaction);
            System.out.println("Transaction commited ...");
           
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.