Package org.ozoneDB

Examples of org.ozoneDB.ExternalTransaction.begin()


            try {               
                StringReader in = new StringReader((String)value);
                InputSource source = new InputSource(in);
                SAXParser parser = parserFactory.newSAXParser();
                ParserAdapter adapter = new ParserAdapter( parser.getParser() );
                tx.begin();
                adapter.setContentHandler( container.storeSAX() );
                adapter.parse( source );
                tx.commit();
            }
            catch (SAXException e) {
View Full Code Here


    * @return The XML content as a DOM <code>Node</code>
    */
    public Node getContentAsDOM() throws XMLDBException {
        ExternalTransaction tx = database.newTransaction();       
        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;
View Full Code Here

                System.out.println("XMLResourceImpl.setContentAsDOM() - Content is null");
                throw new XMLDBException(ErrorCodes.INVALID_RESOURCE);
            }
            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

    *  <code>Resource</code> content.   
    */
    public void getContentAsSAX( ContentHandler handler ) throws XMLDBException {
        ExternalTransaction tx = database.newTransaction();       
        try {
            tx.begin();
            container.extractSAX(handler);
            tx.commit();
        }
        catch (Exception e) {
            try {
View Full Code Here

    *  into the <code>Resource</code>.
    */
    public ContentHandler setContentAsSAX() throws XMLDBException {
        ExternalTransaction tx = database.newTransaction();               
        try
            tx.begin();
            ContentHandler handler = container.storeSAX();
            tx.commit();
            return handler;
        }
        catch (Exception e) {
View Full Code Here

     *
     */ 
    private String toString(String type, String encoding, boolean indenting) throws Exception {       
        int depth = -1;
        ExternalTransaction tx = database.newTransaction();
        tx.begin();
        try {
            StringWriter writer = new StringWriter();
            XMLSerializer serializer = new XMLSerializer( writer, new OutputFormat(type, encoding, indenting) );
            ContentHandler handler = serializer.asContentHandler();
            container.extractSAX( handler, null, depth );
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.