Hi,

I wonder why doUpdate and doDelete in BasePeer do not return the affected rows.

My problem:
I operate on a table with indepentend threads in different VMs.
Each thread looks for rows to process. When it finds one, the thread should set the 
"in_process" boolean to "1".

To make sure that no two processes process the same row I would like to:
1) select the row (in_process has to be FALSE) [e.g. pk_id=4711]
2) do an update on the row: UPDATE table WHERE pk_id=4711 AND in_process=0 SET 
in_process=1
3) the thread should check the number of updated rows, normally returned by this 
statement above.
4) a) 1 row alterd means: success! thread can process the row...
   b) 0 rows altered means: in_process was already set to "1" (by another thread) 
before the update-statement.

So I need the affected rows... But how?

Is the only solution to use executeStatement with the correct SQL-Statement?

Best regards,
Frank


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to