Package net.jini.core.transaction

Examples of net.jini.core.transaction.Transaction.commit()


                      "Taking unavailable entry");
        if (jsWriter.e != null) {
            throw new TestException("Taking unavailable entry failed.",
                                    jsWriter.e);
        }
        txn.commit();
        reset();

        entriesToAdd.clear();
        leasesToAdd.clear();
View Full Code Here


        }
        if (jsWriter3.e != null) {
            throw new TestException("Taking unavailable entry: test2 failed.",
                                    jsWriter3.e);
        }
        txn.commit();
        reset();

        space.write(sampleEntry1, null, leaseForeverTime);
        space.write(sampleEntry1, null, leaseForeverTime);
View Full Code Here

        expectedResult.add(sampleEntry1);
        expectedResult.add(sampleEntry1);
        txn = getTransaction();
        testTemplates(templates, txn, timeout1, 2, expectedResult,
                      "Taking not more than maxEntries");
        txn.commit();
        reset();

        txn = getTransaction();
        templates.add((SimpleEntry) sampleEntry1.clone());
        templates.add("Not an antry");
View Full Code Here

            space05.take(null, txn, instantTime, MAX_ENTRIES);
            throw new TestException("NullPointerException is not thrown "
                                    + "when templates is null");
        } catch (NullPointerException e) {}

        txn.commit();

        // transaction txn is not null and is not usable by the space
        try {
            space05.take(templates, txn, instantTime, MAX_ENTRIES);
            throw new TestException("TransactionException is not thrown "
View Full Code Here

        expectedResult.add(sampleEntry1);
        expectedResult.add(sampleEntry2);
        expectedResult.add(sampleEntry3);
        testTemplates(templates, txn, instantTime, MAX_ENTRIES, expectedResult,
                      "Previous exceptions should not have affected the space");
        txn.commit();
    }

    /**
     * Takes entries from the space by specified templates and
     * makes sure the taken entries are equal to the expected result
View Full Code Here

        // check that written entries are available in the space
        SimpleEntry resultEntry1 = (SimpleEntry) space05.read(sampleEntry1,
                                                              txn, checkTime);
        SimpleEntry resultEntry2 = (SimpleEntry) space05.read(sampleEntry2,
                                                              txn, checkTime);
        txn.commit();
        if (resultEntry1 == null || resultEntry2 == null) {
            throw new TestException("performed write of " + sampleEntry1
                                    + " with " + leaseTime1
                                    + " lease time and "
                                    + sampleEntry2 + " with " + leaseTime2
View Full Code Here

        if (result == null) {
            throw new TestException(sampleEntry3 + " with " + leaseTime2
                                    + " lease time"
                                    + " is not available in the space.");
        }
        txn.commit();

        cleanSpace(space);
        txn = getTransaction();
        entriesList.clear();
        leasesList.clear();
View Full Code Here

            throw new TestException("Some entries were written to the space "
                                    + "despite write operation threw "
                                    + "NullPointerException");
        }

        txn.commit();

        // transaction txn is not null and is not usable by the space
        entriesList.clear();
        leasesList.clear();
        entriesList.add(sampleEntry1);
View Full Code Here

                            meanTime.startTiming();
                            Entry result = entry.execute();
                            meanTime.stopTiming();
                            space.write(result, tx, timeout);
                            if(tx != null)
                                tx.commit();
                            rate.increment();
                            throughput.increment();
                        }
                    }
                } catch (InterruptedException e) {
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.