Victor Ng wrote:
> I find this interesting too since the use of numeric instead of a
> float is the right decision most of the time.
>
> If you're dealing with money at all - you absolutely cannot use float,
> you *must* use fixed decimal types or you risk getting into all kinds
> of really terrible rounding errors.

Even if you are right and the use of numeric is the right decision,
still naming the fixed decimal type 'float' is, well, surprising ;-)

> I'm frankly surprised that a scientific computing app is using float
> with any degree of success.

It's a lot easier to use float where fixed suits better, than other way
round.

> The long running transaction support discussed in point #1 will fail
> if data is modified between loading the initial page on GET and

Yes, it will fail, with a good explanation for the user, and that is
the desired behavior. And it is not a long running transaction in
the dbms.

> submitting data on the POST.  A simple SELECT FOR UPDATE doesn't solve
> this problem at all, you actually need a full blown unit of work
> pattern implemented on the server side that ties to your session.

I will really appreciate an example showing when SELECT FOR UPDATE
is not sufficient. GET is not important, it does not start a
transaction in db.
POST can be constructed even without contact to the database, it only
should contain all information from all fields of the affected rows of
all the affected tables (it's OK if the client just guessed all this
information correctly), and the new information for UPDATEs.
No long-lasting transactions involved.
The session is needed only for authentication.

I think I can create a model where the mentioned 'optimistic approach'
will fail, but the full described approach seems to me correct. I want
to know what I am overlooking, please help me to understand.

> vic
>
> Using floating point math is well
>
> --
> "Never attribute to malice that which can be adequately explained by
> stupidity."  - Hanlon's Razor

Best regards,
V.Chukharev


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

Reply via email to