Subject RE: [firebird-support] Some performance problems.
Author Si Carter
> -----Original Message-----
> Your shot in the dark hit the target.
> I do not have a commit after the insert.
> The problem is I never do "BeginTransaction" in my program.
> So I don't have the option to commit as far as I understand.
> If I look at the FbConnection object, I see that the
> activeTransaction is always null.
>
> 1) Is there a way to tell the Database to commit itself after
> a certain number of INSERTs?

Not that I'm aware of.

> 2) Is it ok to commit the transaction after every INSERT, or
> will it create a performance problem for the INSERT?

It depends on how many inserts, tbh you are probably better inserting the
lot in one transaction, if you are going to split it you might want to
commit every 5000 or so inserts.

> What am I doing wrong???? (I know I am doing something wrong
> but I can't find any good esplanation about using
> transactions in firebird )

Not sure if it will help, but take a look at
(http://www.fbtalk.net/viewtopic.php?id=257) which is what I use as a base
class for the DB layer in firebird/.net apps. There are two template procs,
one uses a reader, the other is used for sp execution and a couple of
wrapper functions to make life easier.

Rgds

Si Carter
http://www.fbtalk.net/ - Web Based Firebird Forum
http://www.tectsoft.net/ - Homepage