Call ContentState.flush() to clear the feature type (and any other cached
information). Handy when the structure of your database changes on disk.

You can use the feature source on multiple threads. If you want to allow
read/write from multiple threads you should probably consider using a
Transaction.

You may find that using a transaction performs better (as the feature
source will hold onto the connection, rather than fetching a new one out of
the connection pool each time as with Transaction.AUTO_COMMIT).

Jody

--
Jody Garnett

On 28 January 2015 at 15:39, Hasan Riaz <hasa...@gmail.com> wrote:

> In the createFeatureSource method of the JDBCFeatureSource class, the code:
>
> SimpleFeatureType schema =
> entry.getState(Transaction.AUTO_COMMIT).getFeatureType();
>
> indicates that the schema seems to be a cached object - indicating that
> once computed it may not need to be computed again. Is this assumption
> correct? If so, is there an "expire" per say of this computation?
>
> I am asking this question because creating the feature source takes time
> and due to performance reasons, I want to know if the feature source can be
> "cached" and used across multiple threads. Also, I am ensuring that I am
> using a singleton DataStore instance for thread safety in a multi threaded
> application, is this approach correct. The database that I am connecting to
> is a PostGres database.
> Thanks,
> Hasan
>
>
>
>
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is
> your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/
> _______________________________________________
> GeoTools-GT2-Users mailing list
> GeoTools-GT2-Users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users
>
>
------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
GeoTools-GT2-Users mailing list
GeoTools-GT2-Users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to