Package org.wso2.carbon.registry.core

Examples of org.wso2.carbon.registry.core.Registry.beginTransaction()


                                                Customer customer) throws BillingException {
        DataAccessObject dataAccessObject = BillingManager.getInstance().getDataAccessObject();
        List<Subscription> subscriptions = null;
        boolean succeeded = false;
        try {
            dataAccessObject.beginTransaction();
            if (customer == null) {
                subscriptions = dataAccessObject.getFilteredActiveSubscriptions(filter);
            } else {
                subscriptions = dataAccessObject.getFilteredActiveSubscriptionsForCustomer(filter, customer);
            }
View Full Code Here


    private Item getItem(int itemId) throws BillingException {
        DataAccessObject dataAccessObject = BillingManager.getInstance().getDataAccessObject();
        Item item = null;
        boolean succeeded = false;
        try {
            dataAccessObject.beginTransaction();
            item = dataAccessObject.getItem(itemId);
            succeeded = true;
        } finally {
            if (succeeded) {
                dataAccessObject.commitTransaction();
View Full Code Here

    public static void deleteAllTables() throws BillingException {
        DataAccessObject dataAccessObject = BillingManager.getInstance().getDataAccessObject();
        boolean succeeded = false;
        try {
            dataAccessObject.beginTransaction();
            /*dataAccessObject.deleteInvoiceSubscriptionItems();
            dataAccessObject.deleteInvoiceSubscriptions();
            dataAccessObject.deletePaymentSubscriptions();
            dataAccessObject.deletePayments();
            dataAccessObject.deleteInvoice();
View Full Code Here

        // here we are initializing the packages
        List<MultitenancyPackage> multitenancyPackages = billingInfo.getMultitenancyPackages();
        boolean succeeded = false;
        try {
            dataAccessObject.beginTransaction();
            for (MultitenancyPackage multitenancyPackage : multitenancyPackages) {
                // check the package existence in the database; If not available, insert it
                int itemId = dataAccessObject.getItemIdWithName(multitenancyPackage.getName());
                if (itemId == DataAccessObject.INVALID) {
                    itemId = dataAccessObject.addItem(multitenancyPackage);
View Full Code Here

        DataAccessObject dataAccessObject = Util.getBillingManager().getDataAccessObject();
        List<Subscription> subscriptions = null;
        boolean succeeded = false;
        Map<Integer, Customer> customersCash = new HashMap<Integer, Customer>();
        try {
            dataAccessObject.beginTransaction();
            if (customer == null) {
                subscriptions = dataAccessObject.getFilteredActiveSubscriptions(filter);
            } else {
                subscriptions = dataAccessObject.getFilteredActiveSubscriptionsForCustomer(filter, customer);
            }
View Full Code Here

    if (!dataService.isInTransaction()) {
      /* an active transaction has already started by the transaction manager,
       * e.g. external JMS transaction */
      if (dataService.isEnableXA() && !dataService.getDSSTxManager().hasNoActiveTransaction()) {
        /* signal we are inside a transaction */
        dataService.beginTransaction();
        inTx = true;
      }
    }
    OMElement result = processSingleRequest();
    if (inTx) {
View Full Code Here

      List<SingleDataServiceRequest> requests = this.getDSRequests();
      int count = requests.size();
      /* set the batch request count in TL */
      DBUtils.setBatchRequestCount(count);
      /* begin a new data service transaction */
      dataService.beginTransaction();
      /* dispatch individual requests */
      for (int i = 0; i < count; i++) {
        /* set the current batch request number in TL */
        DBUtils.setBatchRequestNumber(i);
        /* execute/enqueue request */
 
View Full Code Here

      DSSessionManager.setBoxcarring(true);
    } else if (BoxcarringOps.END_BOXCAR.equals(this.getRequestName())) {
      /* execute all the stored requests */
      DataService dataService = this.getDSRequest().getDataService();
      try {
        dataService.beginTransaction();
          OMElement lastRequestResult = DSSessionManager.getCurrentRequestBox().execute();
          dataService.endTransaction();
          return lastRequestResult;
      } catch (DataServiceFault e) {
        dataService.rollbackTransaction();
View Full Code Here

        OMElement data = fac.createOMElement("configuration",null);

        Registry registry = Util.getConfigSystemRegistry(0);
        boolean success = false;
        try {
            registry.beginTransaction();

            String secretKeyPath = EMAIL_VERIFICATION_COLLECTION + "/" + secretKey;
            if (!registry.resourceExists(secretKeyPath)) {
                String msg = "Email verification failed.";
                log.error(msg);
View Full Code Here

            OMElement[] elements = xmlConfiguration.getElements("//ns:Scenario");

            boolean transactionStarted = Transaction.isStarted();
            if (!transactionStarted) {
                registry.beginTransaction();
            }

            for (OMElement scenarioEle : elements) {
                SecurityScenario scenario = new SecurityScenario();
                String scenarioId = scenarioEle.getAttribute(SecurityConstants.ID_QN)
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.