[OSM-dev] osmosis problem with truncate

Brett Henderson brett at bretth.com
Wed Oct 28 06:54:48 GMT 2009


Stephan Knauss wrote:
> Hi,
>
> is this a bug or am I using it wrong? Sporadically osmosis throws an 
> exception. I do not understand the reason because I wanted to clear the 
> db before an import using the truncate task.
>   
You're just using it wrong :-)  In your defence it isn't entirely 
obvious.  Osmosis has two types of tasks under the covers, active tasks 
which run in their own thread, and passive tasks which are called from 
other task threads.

In your case the active --truncate-pgsql and --fast-read-xml (connected 
indirectly to the --write-pgsql task) tasks are both executing in 
parallel which means that the --truncate-pgsql and --write-pgsql task 
both access the database concurrently.  There is no way to tell osmosis 
to finish --truncate-pgsql before starting --fast-read-xml.  You'll have 
to run them separately.
> Osmosis is called like this:
>
> osmosis --truncate-pgsql database=db user=pg --fast-read-xml-0.6 
> file=f.osm --buffer --write-pgsql user=pg database=db
>
>   






More information about the dev mailing list