Package org.exist.storage.txn

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


                    perm.setOwner(owner);
                    perm.setGroup(ownerGroup);
                }
                transaction.registerLock(collection.getLock(), Lock.WRITE_LOCK);
                broker.saveCollection(transaction, collection);
                transact.commit(transaction);
                broker.flush();
                return;
            }
            transact.abort(transaction);
            throw new PermissionDeniedException("not allowed to change permissions");
View Full Code Here


                {broker.moveResource(transaction, doc, destination, newName);}
            else
// TODO check XML/Binary resource
//                broker.copyResource(transaction, doc, destination, newName);
                {broker.copyResource(transaction, doc, destination, newName);}
            transact.commit(transaction);
//            documentCache.clear();
            return;
        } catch (final LockException e) {
            transact.abort(transaction);
            throw new RemoteException("Could not acquire lock on document " + docPath);
View Full Code Here

            }
            if(move)
                {broker.moveCollection(transaction, collection, destination, newName);}
            else
                {broker.copyCollection(transaction, collection, destination, newName);}
            transact.commit(transaction);
//            documentCache.clear();
            return true;
        } catch (final IOException e) {
          transact.abort(transaction);
            throw new RemoteException(e.getMessage());           
View Full Code Here

            final Account lo = manager.getAccount(userName);
            doc.setUserLock(lo);
// TODO check XML/Binary resource
//            broker.storeDocument(transaction, doc);
            broker.storeXMLResource(transaction, doc);
            transact.commit(transaction);
            return;
        } catch (final Exception e) {
            transact.abort(transaction);
            throw new RemoteException(e.getMessage());
        } finally {
View Full Code Here

        try {
            LOG.info(String.format("Start indexing collection %s", collection.getURI().toString()));
            pool.getProcessMonitor().startJob(ProcessMonitor.ACTION_REINDEX_COLLECTION, collection.getURI());
            reindexCollection(transaction, collection, mode);
            transact.commit(transaction);

        } catch(final Exception e) {
            transact.abort(transaction);
            LOG.warn("An error occurred during reindex: " + e.getMessage(), e);
View Full Code Here

            //NULL transaction, so temporary fragment is not journalled - AR
            storeXMLResource(transaction, targetDoc);
            flush();
            closeDocument();
            //commit the transaction
            transact.commit(transaction);
            return targetDoc;
        } catch(final Exception e) {
            LOG.warn("Failed to store temporary fragment: " + e.getMessage(), e);
            //abort the transaction
            transact.abort(transaction);
View Full Code Here

        }
        final TransactionManager transact = pool.getTransactionManager();
        final Txn transaction = transact.beginTransaction();
        try {
            removeCollection(transaction, temp);
            transact.commit(transaction);
        } catch(final Exception e) {
            transact.abort(transaction);
            LOG.warn("Failed to remove temp collection: " + e.getMessage(), e);
        } finally {
            transact.close(transaction);
View Full Code Here

                            is,
                            MimeType.BINARY_TYPE.getName(), file.length());
                } finally {
                    is.close();
                }
                txManager.commit(txn);
            } finally {
                txManager.close(txn);
            }
        }
      //System.out.println(file);
View Full Code Here

            transaction = transact.beginTransaction();
            assertNotNull(transaction);

            System.out.println("Removing document dropDocument.xml");
            root.removeXMLResource(transaction, broker, XmldbURI.create("dropDocument.xml"));
            transact.commit(transaction);

            checkIndex(docs, broker, null, null, 0);

            System.out.println("Test PASSED.");
        } catch (Exception e) {
View Full Code Here

            assertNotNull(seq);
            assertEquals(6, seq.getItemCount());

            System.out.println("Removing document r_and_j.xml");
            root.removeXMLResource(transaction, broker, XmldbURI.create("r_and_j.xml"));
            transact.commit(transaction);

            seq = xquery.execute("//LINE[ft:query(., 'bark')]", null, AccessContext.TEST);
            assertNotNull(seq);
            assertEquals(3, seq.getItemCount());
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.