Package org.ozoneDB

Examples of org.ozoneDB.ExternalTransaction.commit()


        try {           
            tx.begin();
            DocumentBuilderFactory builderFactory = new org.apache.xerces.jaxp.DocumentBuilderFactoryImpl();           
            DocumentBuilder documentBuilder = builderFactory.newDocumentBuilder();
            Document doc = container.extractDOM(documentBuilder.newDocument());           
            tx.commit();
            return doc;
        }
        catch (Exception e) {
            try {
                if (tx.getStatus() == tx.STATUS_ACTIVE)
View Full Code Here


            }
            if (content instanceof Document) {
                Document doc = (Document)content; 
                tx.begin();      
                container.storeDOM(doc);               
                tx.commit();
            }
            else {
                System.out.println("Cannot store Nodes right now, must be a Document");
            }                           
        }
View Full Code Here

    public void getContentAsSAX( ContentHandler handler ) throws XMLDBException {
        ExternalTransaction tx = database.newTransaction();       
        try {
            tx.begin();
            container.extractSAX(handler);
            tx.commit();
        }
        catch (Exception e) {
            try {
                if (tx.getStatus() == tx.STATUS_ACTIVE)
                    tx.rollback();           
View Full Code Here

    public ContentHandler setContentAsSAX() throws XMLDBException {
        ExternalTransaction tx = database.newTransaction();               
        try
            tx.begin();
            ContentHandler handler = container.storeSAX();
            tx.commit();
            return handler;
        }
        catch (Exception e) {
            try {
                if (tx.getStatus() == tx.STATUS_ACTIVE)
View Full Code Here

            StringWriter writer = new StringWriter();
            XMLSerializer serializer = new XMLSerializer( writer, new OutputFormat(type, encoding, indenting) );
            ContentHandler handler = serializer.asContentHandler();
            container.extractSAX( handler, null, depth );
            writer.flush();
            tx.commit();
            return writer.toString();
        }
        catch (Exception e) {
            if (tx.getStatus() == tx.STATUS_ACTIVE)
                tx.rollback();
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.