Package com.dbxml.db.core.transaction

Examples of com.dbxml.db.core.transaction.Transaction


   }

   public static final String[] PARAMS_setValue = {"value"};

   public void setValue(byte[] value) throws DBException {
      Transaction tx = new Transaction();
      try {
         col.setRecord(tx, docName, new Value(value));
      }
      catch ( DBException e ) {
         tx.cancel();
         throw e;
      }
      finally {
         if ( tx.getStatus() == Transaction.ACTIVE )
            tx.commit();
      }
   }
View Full Code Here


   /**
    * flushConfig ensures that the Collection configuration has been
    * properly flushed to disk after a modification.
    */
   public void flushConfig() throws DBException {
      Transaction tx = new Transaction();
      try {
         userStack.pushCurrentUser(magicUser);

         Document d = config.getElement().getOwnerDocument();
         Collection col = sysCol.getCollection(SystemCollection.CONFIGS);
         DocumentTable dt = DTSMHelper.documentToTable(d, col.getSymbols());
         col.setDocument(tx, COLKEY, dt);
      }
      catch ( Exception e ) {
         tx.cancel();
         System.err.println("Error Writing Configuration '" + name + "'");
      }
      finally {
         userStack.popCurrentUser();

         if ( tx.getStatus() == Transaction.ACTIVE )
            tx.commit();
      }
   }
View Full Code Here

   public String createKey() throws dbXMLException {
      return col.createNewOID().toString();
   }

   public Document getDocument(String docKey) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         return domAdapter.getDocument(tx, docKey);
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
      }
      finally {
         if ( tx.getStatus() == Transaction.ACTIVE )
            tx.commit();
      }
   }
View Full Code Here

            tx.commit();
      }
   }

   public String getDocumentAsText(String docKey) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         return DTSMHelper.tableToText(col.getDocument(tx, docKey));
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
      }
      finally {
         if ( tx.getStatus() == Transaction.ACTIVE )
            tx.commit();
      }
   }
View Full Code Here

            tx.commit();
      }
   }

   public ContentClient getContent(String key) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         Container con = col.getContainer(tx, key);
         if ( con != null )
            return new ContentClientImpl(this, con);
         else
            throw new dbXMLException("Content '" + key + "' not found");
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
      }
      finally {
         if ( tx.getStatus() == Transaction.ACTIVE )
            tx.commit();
      }
   }
View Full Code Here

            tx.commit();
      }
   }

   public String insertDocument(Document document) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         DocumentTable dt = DTSMHelper.documentToTable(document, col.getSymbols());
         return col.insertDocument(tx, dt).toString();
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
      }
      finally {
         if ( tx.getStatus() == Transaction.ACTIVE )
            tx.commit();
      }
   }
View Full Code Here

            tx.commit();
      }
   }

   public String insertDocumentAsText(String document) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         DocumentTable dt = DTSMHelper.textToTable(document, col.getSymbols());
         return col.insertDocument(tx, dt).toString();
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
      }
      finally {
         if ( tx.getStatus() == Transaction.ACTIVE )
            tx.commit();
      }
   }
View Full Code Here

            tx.commit();
      }
   }

   public void setDocument(String docKey, Document document) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         DocumentTable dt = DTSMHelper.documentToTable(document, col.getSymbols());
         col.setDocument(tx, docKey, dt);
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
      }
      finally {
         if ( tx.getStatus() == Transaction.ACTIVE )
            tx.commit();
      }
   }
View Full Code Here

      }
   }


   public void setDocumentAsText(String docKey, String document) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         DocumentTable dt = DTSMHelper.textToTable(document, col.getSymbols());
         col.setDocument(tx, docKey, dt);
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
      }
      finally {
         if ( tx.getStatus() == Transaction.ACTIVE )
            tx.commit();
      }
   }
View Full Code Here

            tx.commit();
      }
   }

   public void remove(String docKey) throws dbXMLException {
      Transaction tx = new Transaction();
      try {
         col.remove(tx, docKey);
      }
      catch ( dbXMLException e ) {
         tx.cancel();
         throw e;
      }
      finally {
         if ( tx.getStatus() == Transaction.ACTIVE )
            tx.commit();
      }
   }
View Full Code Here

TOP

Related Classes of com.dbxml.db.core.transaction.Transaction

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.