Solved

Writing Raster to PostGis locks table

  • 2 December 2015
  • 2 replies
  • 2 views

Userlevel 2
Badge +16

I try to write multiple Raster images to a single PostGis table. Writing the records sequentially is working as designed.

But I am using FME Cloud and want to write records parallel using multiple engines. The first record is written, but seems to lock the table. Therefor all other processes fail.

How can I avoid the table lock in PostGis?

Any suggestions?

icon

Best answer by courtney_m 3 December 2015, 18:53

View original

2 replies

Badge

There is a "Features Per Transaction" parameter on the PostGIS Writer - try setting this to 1. If this is >1, the workspace might be triggering a bulk insert. If this is the case, the first job will issue table-level lock in PostGIS, which will cause the subsequent jobs to fail. If "Features Per Transaction" = 1, each job should only issue a row-level lock in PostGIS for each feature, as it is being written. This will not prevent the other jobs from writing to the same table.

Userlevel 2
Badge +16

There is a "Features Per Transaction" parameter on the PostGIS Writer - try setting this to 1. If this is >1, the workspace might be triggering a bulk insert. If this is the case, the first job will issue table-level lock in PostGIS, which will cause the subsequent jobs to fail. If "Features Per Transaction" = 1, each job should only issue a row-level lock in PostGIS for each feature, as it is being written. This will not prevent the other jobs from writing to the same table.

Yes, setting the Features per Transactions did resolve the problem. Also creating the table before inserting the data, instead of having FME create the table helped.

Reply