On Sat, Sep 27, 2008 at 5:33 AM, Bob Scheifler <[EMAIL PROTECTED]> wrote:
> Niclas Hedhman wrote:
>>
>> 3) Write my entry to the space.
>> spaceService.write( new StorageEntry( id, entry ),
>> currentTransaction(), 6000 );
>>
>> If I commit that and read it back --> No problems.
>>
>> But if I abort the transaction after writing the entry to the space, I
>> can then start a new transaction and still receive the written entry.
>
> Are you sure you aren't just reading the previously committed entry again?
Uhhhh... Well, my testcases ends with remove the stuff that has been
added, and I make sure the entry doesn't exist before the test is
started. But also, I have opposite testcases;
SpaceTransaction transaction = space().newTransaction();
Assert.assertNull( space().readIfExists( "123" ) );
City kualaLumpur = createKualaLumpur();
space().write( "123", kualaLumpur );
Assert.assertNotNull( space().readIfExists( "123" ) );
transaction.abort();
Assert.assertNull( space().readIfExists( "123" ) ); // <-- Fails
And
SpaceTransaction transaction = space().newTransaction();
City kualaLumpur = createKualaLumpur();
space().write( "123", kualaLumpur );
Assert.assertNotNull( space().readIfExists( "123" ) );
transaction.commit();
transaction = space().newTransaction();
City clone = (City) space().takeIfExists( "123" );
Assert.assertNotNull( clone );
Assert.assertNull( space().readIfExists( "123" ) );
transaction.abort();
Assert.assertNotNull( space().readIfExists( "123" ) ); // <-- Fails
Well, since I am always assuming I am a complete idiot, I added an
Iteration test. And now my confidence is hitting a real low;
* If I store 6 entries of the above "kualaLumpur", the
MatchSet.next() will only return 5!! before giving me a null. Any
number minus one.
I'll see if I can locate the Jini testcases and find out what I am
doing differently...
Cheers
Niclas