Option 4 - can be a random string used for an id or an integer  
representing state: 0 (default) not processed, -1 processed already and 1  
for pending.
Can there be more than 1 set of records pending at the same time?

Option 5 is a bad idea - long running transactions are generally a bad  
idea.

On Wed, 30 Sep 2009 20:55:11 +0200, Stefano <[email protected]> wrote:

>
> HI to all,
>
> Problem:
>
> I have an admin generated application.
>
> In generator.yml I had an action in the list:
>
> generator:
>   class: sfPropelGenerator
>
> <snip>
>
> config:
>
> <snip>
>
>   list:
>     action:
>       myAction: ~
>
> MyAction produces a PDF and send it to the browser using sfTCPDF.
>
> After the user has received (and checked) the file I have to ask him
> if I can update the database.
>
> Solutions:
>
> 1) At the end of myAction I can redirect to a confirmation form, but
> if some other user add new records to the database, while I'm waiting
> for the answer, I'll update more records than I have processed.
>
> 2) Store the ids of the records I have processed in the session (can
> be thousands) and recover the ids from it in the action that updates
> the DB.
>
> 3) I can use javascript and attach a onclick method to the link in the
> form; then I can, using AJAX, receive from the browser the command to
> generate the PDF, send the PDF and the ids of the records I have
> processed to the javascript function, have the javascript function
> print the PDF and ask the user if the database can be update, receive
> the response from the javascript function with the ids and, in case,
> update the DB. (It is like the previous solution, but I can use the
> confirm popup, nicer than a form, and forget the ids on the server
> side).
>
> 4) I can add to the DB a field to store an unique random string to
> mark the processed records, the same string I send as a cookie and if
> I receive the ok from the user I can retrieve the cookie and process
> the DB.
>
> 5) for sure there is a simpler way that I can not see.... ;-)  (like
> ask for confirmation without leaving myAction so that I can use
> transaction...)
>
> Stefano
>
> If you think that my question is not symfony related (I'm writing my
> first web application), excuse me for the OT, and forget this message.
>
> >


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

Reply via email to