Package com.hazelcast.core

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


        }
           
        String localMemberAddr = hazelcastInstance.getCluster().getLocalMember().getInetSocketAddress().toString();
        String endpointURI = endpoint.getURI();
        Transaction txn = hazelcastInstance.getTransaction();
        txn.begin();
        try {
            endpointMap.put(endpointURI, endpoint);
            endpointOwners.put(localMemberAddr, endpointURI);
            txn.commit();
        } catch (Throwable e) {
View Full Code Here


        }
           
        String localMemberAddr = hazelcastInstance.getCluster().getLocalMember().getInetSocketAddress().toString();
        String endpointURI = endpoint.getURI();
        Transaction txn = hazelcastInstance.getTransaction();
        txn.begin();
        try {
            endpointMap.put(endpointURI, endpoint);
            endpointOwners.put(localMemberAddr, endpointURI);
            txn.commit();
        } catch (Throwable e) {
View Full Code Here

                // Get and begin transaction if exist
                transaction = endpoint.getHazelcastInstance().getTransaction();

                if (transaction != null && transaction.getStatus() == Transaction.TXN_STATUS_NO_TXN) {
                    log.trace("Begin transaction: {}", transaction);
                    transaction.begin();
                }
            }
            try {
                final Object body = queue.poll(endpoint.getConfiguration().getPollInterval(), TimeUnit.MILLISECONDS);
View Full Code Here

  }

  @Test (expected=IllegalStateException.class)
  public void testCommitThenRollback() {
    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
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.