Hi,

I guess this is topic was touched a lot of times but It would be great to
see your thoughts and experiences about this.

I started to develop an application that really needs to take care about
concurrency issues. So I was thinking about creating a Doctrine behaviour
for this that puts a couple of fields indicating a "version" and,the ID of
the last user that requested the record. So, before update the record, it
would check this version and, if it's different, it would throw an
exception, preventing the corruption of the data. This would be my
implementation of an optimistic concurrency control. Is there a better way
of doing this?

The other topic (althought they're closely related. For this reason I talk
about them in the same post) is application / business transactions that
spam multiple requests. Which would be the better way to implement this? I
was thinking on creating a new form class that saves the input data on the
session between requests (using a DB session storage).. and wrap everything
on a transaction on the last step, checking first the "version" on every
record involved (if it's now new, of course) so I'm confident that the data
is not corrupted before saving the changes.

What would be the best way of implement this in the form framework of
symfony? I was thinking about extending the sfFormDoctrine class, override
the save method and, before anything else, check if this time is the "last
step" of the transaction. If not, save everything on the session and go on.
If it is, check the integritiy of the data (that noone has modified anything
whitin the business transaction), and if everything is fine, go on and save
the record/s.


I'd like to hear your thoughts about it. I want to create a plugin for each
of this topics. Any help or comment would be much appreciated.



Thanks!

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to