[TinyOWS-dev] WFS Transaction locks

Carlos Ruiz boolean10001 at yahoo.com
Wed Sep 21 12:11:35 EST 2011


Olivier,

>As i understand the spec, there's two phases,
>one to lock (LockFeature), one another (Transaction) to apply transaction(s)
>And you could should to release Lock at the end of a/the Transaction,
>or wait till the end of the time limit.

Before the start of the transaction, you must call EnableLongTransactions() to create the required autorization table, then call CheckAuth() to create the trigger on the specified table and finally call for LockRow to lock row by row. Later, the transaction begins and the first thing to do is call AddAuth() to lock the table just within transaction, once COMMIT or ROLLBACK is issued, the changes made by AddAuth are removed automaitcally.. Later you have to call UnlockRows to release all the locks in one step, and call DisableLongTransactions to drop all the triggers that was created.

>So operation must fails if:
>- LockFeature is requested with LOCKACTION=ALL and not able
>  to lock alls.

Ok, that's what I thought. What if TinyOWS could add to the transaction summary those features that couldn't be affected ?

>- Transaction is requested on an already locked feature.

Mmmmm ... what about some SLEEP function to wait for the feature availability ? This reduces the communication payload.

>The WFS way to do it, is to handle feature by feature,
>so row by row for the undelying spatial database seems fine.
>Lock by table, is indeed only a (very) specific use case.

Agree, locking a table is not so efficient (but easiest to implement ;))

>Some others thoughts,
>- DefaultLockExpiry should be set by default to a reasonable small value

When you call for AddAuth, you can specify a time limit. PostGIS default is 1 hour (to much for me) so I'm thinking to set it (maximum) 10 minutes. However, this must be configurable at tinyows.xml or tinyows.map.

>- A boolean should be set in the config file to activate yes or no,
>the lock support

Ok, yes by default ?

>- What about a way to release one/all locks from administrator point of view ?

You can always call UnlockRows to remove the locks, so we can set this in a function to be able to be called by the transaction process or by an administrator.

>Could you write an RFC to describe the main implementation points ?
>(will be needed at a moment to pass through PSC validation)

I never have wrote a RFC before, but I can do it (I will check for some example)

IC Carlos Ruiz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.maptools.org/pipermail/tinyows-dev/attachments/20110921/f9bded7d/attachment.htm 


More information about the TinyOWS-dev mailing list