Hey all,

Thanks for your responses.

2010/1/7 Sören Meyer-Eppler <[email protected]>:
>> Yes, this is a popular request and up to now it was rejected on the
>> grounds that it cannot be guaranteed with all target database servers.
>
> For what it's worth I have personally never needed it and am a bit
> sceptical of the intended use cases. I.e. from the top of my head I
> can imagine more hacks than valid uses.

I think it has a great value when implementing an optimistic locking
strategy (instead of using database locks), which uses a version or
date stamp field to detect whether another thread has concurrently
modified a particular record while doing a read-modify-write/delete
cycle.

The typical way to implement the UPDATE or DELETE statement is to do:

update T(version, ...) set(?, ...) where id = ? and version = ? to
atomically try to increment the version while checking its value.

If the update statement affected no rows, then a concurrent
modification is detected. The same applies to a DELETE statement.

As to whether it cannot be gauranteed by all database servers, I am
unsure, but Java's Hibernate and now JPA standard have a
Query.executeUpdate() method which returns the number of affected
rows, so I would guess there is a solution for most (relevant)
databases?

Personally, I know how to implement this for Sqlite3
(sqlite3_changes()) and MySQL (mysql_affected_rows()), if that helps.

>> Is there any particular issue or problem that you have in mind in
>> relation to the possible inclusion to Boost?
>
> Well, I think SOCI would surely benefit from being included in the
> boost peer review process, test and release cycle. It would also
> increase visibility and user base - which I believe are good things
> for code quality in the long run. It might also attract new
> contributing developers.
>
> So yes, I'd very much welcome a SOCI inclusion into boost.

Besides this, our library (Wt) already depends on boost, and in this
way, we avoid having to add another dependency to our project. This is
not that important to us though.

Regards,
koen

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Soci-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/soci-users

Reply via email to