Package org.exist.storage.txn

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


            root.store(transaction, broker, info, XML3, false);

            System.out.println("store "+doc11uri);
            root.addBinaryResource(transaction, broker, doc11uri.lastSegment(), BINARY.getBytes(), null);

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


            Collection root = broker.getOrCreateCollection(transaction, col1uri);
            assertNotNull(root);
            broker.removeCollection(transaction, root);

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

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

            System.out.println("Removing collection ...");
            broker.removeCollection(transaction, test);
           
            transact.commit(transaction);
            System.out.println("Transaction interrupted ...");
      } catch (Exception e) { 
        e.printStackTrace();
          fail(e.getMessage());              
        } finally {
View Full Code Here

            for (Iterator<DocumentImpl> i = test.iterator(broker); i.hasNext(); ) {
                DocumentImpl doc = i.next();
                broker.removeXMLResource(transaction, doc);
            }
            broker.saveCollection(transaction, test);
            transact.commit(transaction);

            System.out.println("Transaction committed ...");
      } catch (Exception e) {
          fail(e.getMessage());
        } finally {
View Full Code Here

                IndexInfo info = test.validateXMLResource(transaction, broker, doc.getURI(), is);
                assertNotNull(info);
                test.store(transaction, broker, info, is, false);
            }
            generator.releaseAll();
            transact.commit(transaction);
            System.out.println("Transaction committed ...");
      } catch (Exception e) {
            e.printStackTrace();
            fail(e.getMessage());
        } finally {
View Full Code Here

                assertNotNull(modifications);
                modifications[0].process(transaction);
                proc.reset();
            }
           
            mgr.commit(transaction);
            System.out.println("Transaction commited ...");
           
            // the following transaction will not be committed and thus undone during recovery
            transaction = mgr.beginTransaction();
            assertNotNull(transaction);
View Full Code Here

            broker.saveCollection(transaction, root);
           
            Collection test = broker.getOrCreateCollection(transaction, TEST_COLLECTION_URI.append("test2"));
            broker.saveCollection(transaction, test);
           
            transact.commit(transaction);
            System.out.println("Transaction commited ...");
        } catch (Exception e) {
          transact.abort(transaction);
            fail(e.getMessage());             
        } finally {
View Full Code Here

        long addr = domDb.put(txn, new NativeBroker.NodeRef(500, idFact.createInstance(i)), data);
//              TODO : test addr ?
            }
           
            domDb.closeDocument();
            mgr.commit(txn);
            System.out.println("Transaction commited ...");
           
            txn = mgr.beginTransaction();
            System.out.println("Transaction started ...");
           
View Full Code Here

                if (i == 1)
                    firstToRemove = addr;
            }           
           
            domDb.closeDocument();
            mgr.commit(txn);
            System.out.println("Transaction commited ...");
           
            // the following transaction is not committed and will be rolled back during recovery
            txn = mgr.beginTransaction();
            System.out.println("Transaction started ...");
View Full Code Here

            idx = new IndexQuery(IndexQuery.TRUNC_RIGHT, new NativeBroker.NodeRef(501));
            domDb.remove(txn, idx, null);
            domDb.removeAll(txn, firstToRemove);
           
//          Don't commit...
            mgr.commit(txn);
            mgr.getJournal().flushToLog(true);
            System.out.println("Transaction interrupted ...");
           
            Writer writer = new StringWriter();
            domDb.dump(writer);
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.