Geotoolkit

CRS.lookupIdentifier(...) is sometime slower than it should be and can lose connection

Details

Description

The CRS.lookupIdentifier(...) convenience method is slower than it should be, especially when there is no CRS from the database matching the given one, for the following raisons:

  • CachingAuthorityFactory remembers (as expected) the result of previous successful searchs, but do not record which searchs failed. Consequently code that lookup often for the same CRS seem to work normally when the CRS exists in the database, but become very slow if the CRS does not exist.
  • When DirectEpsgFactory fails to find the identifier of a dependency (for example the Datum used by a GeographicCRS) using the database indexes, it conservatively scans every Datum objects. This conservative approach is too aggressive.

In addition, IdentifiedObjectFinder performs its work outside the "acquire factory, use, release" cycle of ThreadedAuthorityFactory. It works but offer no protection against the automatic disposal of factories after a timeout, which may result in a "Connection closed" error message in the middle of lookup if that process was too long. This is more manifest during debugging because of the pause between steps. To prevent that, the work of IdentifiedObjectFinder should be put inside the usual "acquire, use, release" cycle.

Activity

There are no comments yet on this issue.

People

Vote (0)
Watch (0)

Dates

  • Created:
    11/Nov/2009 11:46
    Updated:
    13/Apr/2011 16:08
    Resolved:
    13/Apr/2011 16:08

Time Tracking

Estimated:
1d
Original Estimate - 1 day
Remaining:
0m
Remaining Estimate - 0 minutes
Logged:
1d
Time Spent - 1 day