In the GeoTools Javadoc for Transaction (and in a few other places, such as blogs and so forth) they suggest lines like this for performing transactions on the database:
SimpleFeatureStore road = (SimpleFeatureStore) store.getFeatureSource("road");
where "store", as far as I can work out, is a DataStore. The method returns a WFSFeatureStore, which it wants to cast into a SimpleFeatureStore. However, at runtime, it says that it can't cast this, and halts the program. WFSFeatureStore is a class, SimpleFeatureStore is an interface. Both implement the SimpleFeatureSource interface.
There must be something lost in the description somewhere, because all these places suggest it, but it doesn't work. Can anyone enlighten me?