Package org.exist.storage.txn

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


        broker.saveCollection(transaction, root);
            assertNotNull(root);

            root.addBinaryResource(transaction, broker, XmldbURI.create(name), data.getBytes(), "application/xquery");

            transact.commit(transaction);
        } catch (Exception e) {
            if (transact != null)
                transact.abort(transaction);
            e.printStackTrace();
            fail(e.getMessage());
View Full Code Here


                    try {
                        txn = transaction.beginTransaction();

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

                        transaction.commit(txn);
                    } catch(final Exception e) {
                        transaction.abort(txn);
                        e.printStackTrace();
                        LOG.debug("loading configuration failed: " + e.getMessage());
                    } finally {
View Full Code Here

                try {
                    txn = transaction.beginTransaction();

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

                    transaction.commit(txn);
                } catch (final Exception e) {
                    transaction.abort(txn);
                    LOG.debug(e);
                } finally {
                    transaction.close(txn);
View Full Code Here

                    if (systemCollection == null)
                            {return;}
                    systemCollection.setPermissions(Permission.DEFAULT_SYSTEM_COLLECTION_PERM);
                    broker.saveCollection(txn, systemCollection);

                    transaction.commit(txn);
                }
        } catch (final Exception e) {
            transaction.abort(txn);
            e.printStackTrace();
            LOG.debug("loading acl failed: " + e.getMessage());
View Full Code Here

                //throw new ConfigurationException("Collection '/db/system/security' can't be created.");

                collection.setPermissions(Permission.DEFAULT_SYSTEM_SECURITY_COLLECTION_PERM);
                broker.saveCollection(txn, collection);

                transaction.commit(txn);
            }
        } catch (final Exception e) {
            transaction.abort(txn);
            e.printStackTrace();
            LOG.debug("loading configuration failed: " + e.getMessage());
View Full Code Here

                          aclPermission.addACE(ace.getAccessType(), ace.getTarget(), ace.getWho(), ace.getMode());
                      }
                  }
                  broker.saveCollection(txn, getTarget());
                 
                  txnManager.commit(txn);
               
              } catch (final Exception xe) {
                  txnManager.abort(txn);
                 
                  throw xe;
View Full Code Here

                      for(final ACEAider ace : getAces()) {
                          aclPermission.addACE(ace.getAccessType(), ace.getTarget(), ace.getWho(), ace.getMode());
                      }
                  }
                  broker.storeXMLResource(txn, getTarget());
                  txnManager.commit(txn);
               
              } catch(final Exception xe) {
                txnManager.abort(txn);
               
                throw xe;
View Full Code Here

        DBBroker broker = null;
        try {
            broker = ownerDocument.getBrokerPool().get(null);
            appendChildren(transaction, nl, 0);
            broker.storeXMLResource(transaction, (DocumentImpl) getOwnerDocument());
            transact.commit(transaction); // bugID 3419602
            return getLastChild();
        } catch (final Exception e) {
            transact.abort(transaction);
            throw new DOMException(DOMException.INVALID_STATE_ERR, e.getMessage());
        } finally {
View Full Code Here

        DBBroker broker = null;
        try {
            broker = ownerDocument.getBrokerPool().get(null);
            insertBefore(transaction, nl, refChild);
            broker.storeXMLResource(transaction, (DocumentImpl) getOwnerDocument());
            transact.commit(transaction);
            return refChild.getPreviousSibling();
        } catch(final TransactionException e) {
            transact.abort(transaction);
            throw new DOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, e.getMessage());
        } catch (final EXistException e) {
View Full Code Here

                final XmldbURI configCollection = XmldbURI.CONFIG_COLLECTION_URI.append(targetCollection);
                collection = broker.getOrCreateCollection(txn, configCollection);
                if (collection != null)
                    {broker.removeCollection(txn, collection);}
            }
            mgr.commit(txn);
        } catch (final Exception e) {
            LOG.error("Exception occurred while removing package.", e);
            mgr.abort(txn);
        } finally {
            mgr.close(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.