I was under the impression that some JDBC drivers had an option to work in this fashion. Let me check. Looks like an option for DB2 and MySQL - but not that popular.
In discussion earlier it sounded like this was a regression with respect to the previous AbstractDatastore implementations? Do we know how they approached inserts ... PostgisFeatureWriter <https://github.com/geotools/geotools/blob/2.7.x/modules/unsupported/postgis/src/main/java/org/geotools/data/postgis/PostgisFeatureWriter.java> , JDBCFeatureWriter <https://github.com/geotools/geotools/blob/2.7.x/modules/library/jdbc/src/main/java/org/geotools/data/jdbc/JDBCFeatureWriter.java>. That also seems to insert features one at a time. -- Jody Garnett On 26 October 2015 at 09:59, Patrick Valsecchi < [email protected]> wrote: > While reviewing my batch insert pull request [1], Andrea Aime did a couple > of coments [2] [3] that calls for a broader discussion. > > In summary, I'm trying to improve the GeoTools performance when inserting > a lot of features in the DB. For that, I need to group the insertions > together in order to leverage batch inserts. This is done by adding a > buffer in JDBCInsertFeatureWriter that is flushed every 100 inserts and > when the writer is closed. This can brake the code using it: > > - If the code closes the connection before the writer itgets an > exception. > - If the code forgets to close the writer and the connection, the > features will be inserted when the GC wakes up. > > To me there are several solutions to that: > > - Put a warning in the release notes and let them fix the code. > - Have the default buffer size set to 1 and have a parameter somewhere > (where?) to change it. > > What's your take? > > > Thanks. > [1] https://github.com/geotools/geotools/pull/1009 > [2] https://github.com/geotools/geotools/pull/1009#discussion_r42947268 > [3] https://github.com/geotools/geotools/pull/1009#issuecomment-150946096 > > > ------------------------------------------------------------------------------ > > _______________________________________________ > GeoTools-Devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/geotools-devel > >
------------------------------------------------------------------------------
_______________________________________________ GeoTools-Devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/geotools-devel
