Package org.exist.storage.txn

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


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


                IndexInfo info = parent.validateXMLResource(transaction, broker, docPath, TEMPLATE);
                //TODO : unlock the collection here ?
                parent.store(transaction, broker, info, TEMPLATE, false);
                this.doc = info.getDocument();

                transactMgr.commit(transaction);
            }
        } catch (Exception e) {
            transactMgr.abort(transaction);
            throw new TriggerException(e.getMessage(), e);
        } finally {
View Full Code Here

            if (coll == null) {
                LOG.debug("failed to create collection");
                return false;
            }
            broker.saveCollection(txn, coll);
            transact.commit(txn);
            broker.flush();
            broker.sync(Sync.MINOR_SYNC);
            return true;
        } catch (final Exception e) {
            transact.abort(txn);
View Full Code Here

            if(collection == null) {
                transact.abort(txn);
                return false;
            }
            final boolean removed = broker.removeCollection(txn, collection);
            transact.commit(txn);
            return removed;
        } catch (final Exception e) {
            transact.abort(txn);
            LOG.debug(e.getMessage(), e);
            throw new RemoteException(e.getMessage(), e);
View Full Code Here

            if(doc.getResourceType() == DocumentImpl.BINARY_FILE)
                {collection.removeBinaryResource(txn, broker, doc);}
            else
                {collection.removeXMLResource(txn, broker, docUri);}
           
            transact.commit(txn);
            return true;
        } catch (final Exception e) {
            transact.abort(txn);
            LOG.debug(e.getMessage(), e);
            throw new RemoteException(e.getMessage(), e);
View Full Code Here

// TODO check XML/Binary resource
//          IndexInfo info = collection.validate(txn, broker, path, new InputSource(new ByteArrayInputStream(data)));
            final IndexInfo info = collection.validateXMLResource(txn, broker, docUri, new InputSource(new ByteArrayInputStream(data)));
            info.getDocument().getMetadata().setMimeType(MimeType.XML_TYPE.getName());
            collection.store(txn, broker, info, new InputSource(new ByteArrayInputStream(data)), false);
            transact.commit(txn);
            LOG.debug(
                    "parsing "
                    + path
                    + " took "
                    + (System.currentTimeMillis() - startTime)
View Full Code Here

            long mods = 0;
            for (int i = 0; i < modifications.length; i++) {
                mods += modifications[i].process(transaction);
                broker.flush();
            }
            transact.commit(transaction);
            return (int) mods;
        } catch (final ParserConfigurationException e) {
            transact.abort(transaction);
            throw new RemoteException(e.getMessage(), e);
        } catch (final IOException e) {
View Full Code Here

            long mods = 0;
            for (int i = 0; i < modifications.length; i++) {
                mods += modifications[i].process(transaction);
                broker.flush();
            }
            transact.commit(transaction);
           
            // Release lock, as reported http://markmail.org/message/pau6hoaeybg2bvch
            doc.getUpdateLock().release(Permission.READ);
           
            return (int) mods;
View Full Code Here

            collection.addBinaryResource(txn, broker, docUri, data, mimeType);
//            if (created != null)
//                doc.setCreated(created.getTime());
//            if (modified != null)
//                doc.setLastModified(modified.getTime());
            transact.commit(txn);
        } catch (final Exception e) {
            transact.abort(txn);
            throw new RemoteException(e.getMessage(), e);
        } finally {
            transact.close(txn);
View Full Code Here

                    }
                    perm.setMode(permissions);
// TODO check XML/Binary resource
//                    broker.storeDocument(transaction, doc);
                    broker.storeXMLResource(transaction, doc);
                    transact.commit(transaction);
                    broker.flush();
                    return;
//                    return true;
                }
                transact.abort(transaction);
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.