Subject Re: [IBO] IB Basics?
Author Jason Wharton
If you use a TIB_Connection and do not put down a separate TIB_Transaction
and hook the connection's DefaultTransaction to it then each statement and
dataset will instantiate a separate transaction for itself. So, while Helen
is correct that using the default transaction is good I thought I would make
it very clear how you go about it.

Using a TIB_Database component is exactly the same as doing what I stated
above except that you don't have the option of omitting the default
transaction if you wanted to do so.

HTH,
Jason Wharton
CPS - Mesa AZ
http://www.ibobjects.com


----- Original Message -----
From: "Helen Borrie" <helebor@...>
To: <IBObjects@egroups.com>
Sent: Friday, December 29, 2000 5:25 AM
Subject: Re: [IBO] IB Basics?


> At 01:41 PM 29-12-00 +0200, you wrote:
> >Hi,
> >
> >Is it necessary to use a transaction with an ibquery if i need to read
info
> >from a database only? Do I use ibConnection or ibdatabase?
> >I seem to be getting conflicting answers.
>
>
> Everything in IB is done in a transaction context - that's because
> (potentially) there are different versions of the selected rows at any
> particular moment. Now, IB6 is different from previous versions, in that
> you *can* have a read-only database file, e.g. on CD-ROM. I don't know
> exactly how this works...but if the entire database is read-only you won't
> have to worry about explicit transaction control at all. Use
IB_Connection
> in preference to IB_Database, since for read-only IB_Connection provides
> all you need with less overhead. IB_Database is just for compatibility
> when people are converting directly from a BDE implementation.
>
> Just use IB_Connection's default transaction. I'm pretty sure that, when
> the DB is read-only, OAT doesn't matter at all, because nothing is
changing
> in the database so there is no garbage collection; and readers don't
block
> other readers.
>
> Helen
>
>
> All for Open and Open for All
> InterBase Developer Initiative ยท http://www.interbase2000.org
> _______________________________________________________
>
>
>
>