Hi Andrea - I was able to reproduce the problem on Java 1.4, Java 5 
(friday) and using Java 6 (over the weekend):

As promissed here is the test case, can I ask for a quick eyeball test 
to make sure what I am testing is correct:
> public void testTransactionIndependence() throws Exception {
>         FeatureType ROAD = store.getSchema( "road" );
>         Feature chrisFeature =
>             ROAD.create( new Object[]{ new Integer(5), "chris"}, "fid5" );
>         
>         FeatureStore roadAuto = (FeatureStore) 
> store.getFeatureSource("road");
>         
>         FeatureStore roadFromClient1 = (FeatureStore) 
> store.getFeatureSource("road");
>         Transaction transaction1 = new DefaultTransaction("Transaction 
> Used by Client 1");
>         roadFromClient1.setTransaction( transaction1 );
>         
>         FeatureStore roadFromClient2 = (FeatureStore) 
> store.getFeatureSource("road");
>         Transaction transaction2 = new DefaultTransaction("Transaction 
> Used by Client 2");
>         roadFromClient2.setTransaction( transaction2 );
>
>         FilterFactory2 ff = (FilterFactory2) 
> CommonFactoryFinder.getFilterFactory(null);
>         Filter selectFid1 = ff.id( Collections.singleton( 
> ff.featureId("fid1") ));
>         Filter selectFid2 = ff.id( Collections.singleton( 
> ff.featureId("fid2") ));        
>         
>             
>         // Before we edit everything should be the same
>         assertEquals( "auto before", 4, roadAuto.getFeatures().size() );
>         assertEquals( "client 1 before", 4, 
> roadFromClient1.getFeatures().size() );
>         assertEquals( "client 2 before", 4, 
> roadFromClient2.getFeatures().size() );
>
>         // Remove Feature with Fid1
>         roadFromClient1.removeFeatures( selectFid1 ); // road1 removes 
> fid1 on t1
>         
>         assertEquals( "auto after client 1 removes fid1", 4, 
> roadAuto.getFeatures().size() );
>         assertEquals( "client 1 after client 1 removes fid1", 3, 
> roadFromClient1.getFeatures().size() );
>         assertEquals( "client 2 after client 1 removes fid1", 4, 
> roadFromClient2.getFeatures().size() );               
>         
>         
>         roadFromClient2.addFeatures( DataUtilities.collection( 
> chrisFeature )); // road2 adds fid5 on t2    
>         assertEquals( "auto after client 1 removes fid1 and client 2 
> adds fid5", 4, roadAuto.getFeatures().size() );
>         assertEquals( "client 1 after client 1 removes fid1 and client 
> 2 adds fid5", 3, roadFromClient1.getFeatures().size() );
>         assertEquals( "cleint 2 after client 1 removes fid1 and client 
> 2 adds fid5", 5, roadFromClient2.getFeatures().size() );        
>
>         transaction1.commit();
>         assertEquals( "auto after client 1 commits removal of fid1 
> (client 2 has added fid5)", 3, roadAuto.getFeatures().size() );
>         assertEquals( "client 1 after commiting removal of fid1 
> (client 2 has added fid5)", 3, roadFromClient1.getFeatures().size() );
>         assertEquals( "client 2 after client 1 commits removal of fid1 
> (client 2 has added fid5)", 4, roadFromClient2.getFeatures().size() 
> );                
>             
>         transaction2.commit();
>         assertEquals( "auto after client 2 commits addition of fid5 
> (fid1 previously removed)", 4, roadAuto.getFeatures().size() ); // <-- 
> FAILURE
>         assertEquals( "client 1 after client 2 commits addition of 
> fid5 (fid1 previously removed)", 4, 
> roadFromClient1.getFeatures().size() );
>         assertEquals( "client 2 after commiting addition of fid5 (fid1 
> previously removed)", 4, roadFromClient2.getFeatures().size() );
>     }
So:
1) set up server and two clients against a data set of 4 roads
2) client 1 removes a feature, verify that client 1 sees 3 features
3) client 2 adds a feature, verify that client 2 sees 5 features
4) commit from client one, verify commit succeeded (3 features in the 
database, client 2 sees 4 because it added one)
5) commit from client two .. fails!

It really looks like the second commit has lost its mind... that 
transaction state diff has been busted while I was not looking. We can 
apply this
test case to shapefile datastore for a second test. It was part of the 
default test case that everyone copied, but I have sceen in commented out
on more then one occasion.

Cheers,
Jody

> Cory Horner ha scritto:
>   
>> Cory Horner wrote:
>>     
>>> I'll do some testing in a few minutes.
>>>       
>> Ran "mvn install" on gt2-2.4-M0-src.zip, and got this in demo/property:
>>     
>
> Hum, may it be something java 6 related? What are you using to perform 
> this build?
> Cheers
> Andrea
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Geotools-devel mailing list
> Geotools-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
>   


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to