Package com.hazelcast.core

Examples of com.hazelcast.core.Transaction.commit()


        Transaction txn = hazelcastInstance.getTransaction();
        txn.begin();
        try {
            endpointMap.put(endpointURI, endpoint);
            endpointOwners.put(localMemberAddr, endpointURI);
            txn.commit();
        } catch (Throwable e) {
            txn.rollback();
            throw new ServiceRuntimeException(e);
        }
        localEndpoints.put(endpointURI, endpoint);
View Full Code Here


        Transaction txn = hazelcastInstance.getTransaction();
        txn.begin();
        try {
            endpointMap.put(endpointURI, endpoint);
            endpointOwners.put(localMemberAddr, endpointURI);
            txn.commit();
        } catch (Throwable e) {
            txn.rollback();
            throw new ServiceRuntimeException(e);
        }
        localEndpoints.put(endpointURI, endpoint);
View Full Code Here

                    }
                }
                // It's OK, I commit
                if (exchange.getException() == null && transaction != null && transaction.getStatus() == Transaction.TXN_STATUS_ACTIVE) {
                    log.trace("Commit transaction: {}", transaction);
                    transaction.commit();
                }
            } catch (InterruptedException e) {
                if (LOG.isDebugEnabled()) {
                    LOG.debug("Hzlq Consumer Interrupted: " + e, e);
                }
View Full Code Here

    Transaction transaction = instance.getTransaction();
    transaction.begin();
    IMap<String, String> imap = instance.getMap(AUTH_MAP_NAME);
    assertNull(imap.get("key"));
    imap.put("key", "value");
    transaction.commit();
    // Check that when trying to rollback after having commited will throw an IllegalStageException
    transaction.rollback();   
  }

  @Test
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.