Examples of TransactionCallback


Examples of helpers.TransactionCallback

    @Override
    public void doJob() {
        Logger.info("BEGIN JOB JobFetchRegisteredTicketingUser for all members");

        txTemplate.setReadOnly(true);
        final List<Long> memberIds = txTemplate.execute(new TransactionCallback() {
            public List<Long> doInTransaction() {
                return Member.findAllIds();
            }
        });
View Full Code Here

Examples of org.cruxframework.crux.core.client.db.Transaction.TransactionCallback

    {
    if (callback == null && errorHandler == null)
    {
      return null;
    }
      return new TransactionCallback()
    {
      @Override
      public void onError(String message)
      {
        if (callback != null)
View Full Code Here

Examples of org.mule.api.transaction.TransactionCallback

        TransactionTemplate tt = new TransactionTemplate(endpoint.getTransactionConfig(), receiver.getConnector().getMuleContext());

        // Receive messages and process them in a single transaction
        // Do not enable threading here, but serveral workers
        // may have been started
        TransactionCallback<?> cb = new TransactionCallback()
        {
            public Object doInTransaction() throws Exception
            {
                Transaction tx = TransactionCoordination.getInstance().getTransaction();
                if (tx != null)
View Full Code Here

Examples of org.rhq.core.domain.shared.TransactionCallback

        queries.put(queryName, paramsMap);
    }

    public void testAsyncUninventory() throws Exception {

        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {

                EntityManager entityManager = getEntityManager();
                Query q = entityManager.createNamedQuery(Resource.QUERY_MARK_RESOURCES_FOR_ASYNC_DELETION_QUICK);
View Full Code Here

Examples of org.rhq.enterprise.server.test.TransactionCallback

        });
    }

    private void createInventory() throws Exception {
        purgeDB();
        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {

                resourceType = new ResourceType(RESOURCE_TYPE, PLUGIN, SERVER, null);
                em.persist(resourceType);
View Full Code Here

Examples of org.rhq.enterprise.server.test.TransactionCallback

    private void purgeDB() {
        purgeBaselines();
        purgeOOBs();

        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                ResourceCriteria c = new ResourceCriteria();
                c.addFilterInventoryStatus(null);
                c.addFilterResourceKey(RESOURCE_KEY);
View Full Code Here

Examples of org.rhq.enterprise.server.test.TransactionCallback

    private void purgeOOBs() {
        purgeTables("rhq_measurement_oob");
    }

    private void purgeTables(final String... tables) {
        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                for (String table : tables) {
                    getEntityManager().createNativeQuery("delete from " + table).executeUpdate();
                }
View Full Code Here

Examples of org.rhq.enterprise.server.test.TransactionCallback

            }
        });
    }

    private void insertBaselines(final List<MeasurementBaseline> baselines) {
        executeInTransaction(false, new TransactionCallback() {
            @Override
            public void execute() throws Exception {
                EntityManager em = getEntityManager();
                for (MeasurementBaseline baseline : baselines) {
                    em.persist(baseline);
View Full Code Here

Examples of org.rhq.enterprise.server.test.TransactionCallback

   
    @Test(groups = "integration.ejb3")
    public void testStorageNodeCriteriaFinder() throws Exception {

        final int storageNodeCount = 42;
        executeInTransaction(new TransactionCallback() {

            public void execute() throws Exception {
                // verify that all storage nodes objects are actually parsed.
                final Set<String> nodeAddresses = new HashSet<String>(storageNodeCount);
View Full Code Here

Examples of org.rhq.enterprise.server.test.TransactionCallback

        });
    }
   
    @Test(groups = "integration.ejb3")
    public void testStorageNodeAckFailedOperation() throws Exception {
        executeInTransaction(new TransactionCallback() {

            @Override
            public void execute() throws Exception {
                StorageNode node = StorageNodeFactory.newInstance();
                final String address = TEST_PREFIX + "foo.com";
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.