Subject Re: [firebird-support] Sweep Interval
Author Helen Borrie
At 11:17 AM 12/01/2004 +0800, you wrote:
>In my application I always doing a hard commit
>(ib_transaction.commitretainning;)

CommitRetaining is NOT a hard commit, it is a soft commit.

>every time a record has been post or
>update to make sure that all the other client are viewing the lastest
>and updated records.

Post + CommitRetaining is exactly what Autocommit does. CommitRetaining is
a Borland hack that enables an almost-dirty read. It's not a dirty read,
because it updates the current recordversion as a Commit does, and other
transactions don't see it until it is committed; but from the POV of
transaction isolation it is not very clean.

>Will there be any bad effect to the Firebird
>performance if I always making a hard commit?

A hard commit - COMMIT - probably uses less CPU resource than a soft
commit. Its effect on performance overall is much better because of its
favourable effect on garbage collection and the fact that the transaction
resources get released.

The question I think you really want to ask is whether it's a bad thing to
commit every time you post. And the correct answer to this is
"maybe". :-) It really gets down to how your users are working. If you
have 100 users all editing the same 1000 rows in one table at random all
day long, you probably need to make your commits instantaneously, to avoid
a high level of conflicts. "Performance" to these users means not having
to wait for someone else to come back from a coffee break. If you have
apps that don't do much else except data entry of stuff that nobody is
waiting for, then post-commit-post-commit isn't justified - it would be
more efficient for the user and the network to let her batch her task and
commit after every 20 inserts, or whatever works for her.

/hb