Package org.xmldb.api.modules

Examples of org.xmldb.api.modules.TransactionService


   // Transaction support is optional for level 0 compliance
   private void transactionalInsertDOMDocument(String id1, Document document1,
                    String id2, Document document2) throws Exception {

        TransactionService transaction =
           (TransactionService) col.getService("TransactionService", "1.0");

        transaction.begin();

        XMLResource resource1 =
           (XMLResource) col.createResource(id1, XMLResource.RESOURCE_TYPE);

        resource1.setContentAsDOM(document1);
        col.storeResource(resource1);

        XMLResource resource2 =
           (XMLResource) col.createResource(id2, XMLResource.RESOURCE_TYPE);

        resource2.setContentAsDOM(document2);
        col.storeResource(resource2);

        transaction.commit();

   }
View Full Code Here

TOP

Related Classes of org.xmldb.api.modules.TransactionService

Copyright © 2018 www.massapicom. 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.