Changing the trigger from AFTER trigger to BEFORE trigger seems to work ok

El miércoles, 19 de septiembre de 2012 20:33:19 UTC+2, Michael Pedersen 
escribió:
>
> On Wed, Sep 19, 2012 at 1:02 PM, Juan Antonio Ibáñez 
> <[email protected] <javascript:>> wrote: 
> > But it seems the trigger doesn't gets executed until the transaction is 
> commited so I get always old balance instead new one 
>
> Ah, yes, this will be a problem regardless of your database, and it's 
> not one that I know of a solid way to solve. The real problem is that 
> your database trigger will take an unknown time to run. In testing, it 
> could (and probably will) be under a second. In production, depending 
> on the amount of data and the load on the server, it could take 
> minutes or even hours. Web browsers will give up after a limited 
> amount of time, reporting that the remote web server is not 
> responsive. 
>
> I've only got one option, and I really don't like it. 
>
> Set up some sort of notification from the server to your app, so that 
> the database trigger will notify when the calculation is done. The app 
> can then hold the information in memory, waiting for the web browser 
> to request it. In the meantime, the browser periodically queries your 
> app to see if there is an updated balance, displaying "updating" until 
> it gets a result. 
>
> -- 
> Michael J. Pedersen 
> My Online Resume: http://www.icelus.org/ -- Google+ 
> http://plus.ly/pedersen 
> Google Talk: [email protected] <javascript:> -- Twitter: pedersentg 
>

-- 
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/turbogears/-/qMeYogCtRmkJ.
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/turbogears?hl=en.

Reply via email to