Board index » delphi » Newbie questions

Newbie questions

Hi:

I haven't use Interbase for several years (IIRC, it is version 3.5 in 1997),
and I start to play with Interbase again and Interbase Express (of course,
Interbase Express is a totally new beast for me).

First, in a multi-user environment, if another user modified a record and
commit the change.  Even I refresh my query (close and reopen), I still
cannot see the change.  I must commit my transaction first (and I must use
Commit and not CommitRetaining).  I remember Interbase use something call
multi-generation, does this has anything to do with this behavior.  I don't
recall I have to do a commit before with BDE, is it because BDE commits for
me?

Another annoying thing is commit close all associated datasets, anyone know
why?  And if the transactions components closed all associated datasets,
shouldn't it reopen them?  Why commit changes the states of all associated
datasets?  Is there a property in the transaction or the dataset component
that controls this behavior?  I haven't been able to find one.

The following not is extracted from the online-help:
In applications that connect an InterBaseExpress dataset to a client
dataset, every query must be in its own transaction.  You must use one
transaction component for each query component.

If the dataset is not connected to a clientdataset, do we need a dedicated
transaction for every query?  If not, why is this required when connected to
a clientdataset?

TIA,
Ping Kam

 

Re:Newbie questions


In article <3c87dfe7$1_2@dnews>, p...@quikcard.com says...

Quote

> First, in a multi-user environment, if another user modified a record and
> commit the change.  Even I refresh my query (close and reopen), I still
> cannot see the change.  I must commit my transaction first (and I must use
> Commit and not CommitRetaining).  I remember Interbase use something call
> multi-generation, does this has anything to do with this behavior.  

        What you are seeing is transaction isolation.  Multi-generational
architecture is an implementation detail (it's how IB implements
transaction isolation, which is required for any high-quality SQL
server).  You should never be allowed to see uncommitted data.

Quote
> I don't
> recall I have to do a commit before with BDE, is it because BDE commits for
> me?

        Yes, that's right.

Quote
> Another annoying thing is commit close all associated datasets, anyone know
> why?  

        Because you can't read any more data from a dataset associated with
an inactive transaction.  The BDE works around this limitation in an
incredibly horrific (for performance) way: A FetchAll on every open
dataset in your entire application, and buffering the result sets of all
of them in memory.  (Really!  Look at SQL Monitor sometime...)

Quote
> And if the transactions components closed all associated datasets,
> shouldn't it reopen them?

        That's an option, but IBX doesn't make that presumption for you,
because there is a lot of overhead to this.

Quote
> The following not is extracted from the online-help:
> In applications that connect an InterBaseExpress dataset to a client
> dataset, every query must be in its own transaction.  You must use one
> transaction component for each query component.

        This is no longer correct -- it was fixed a while back.

Quote
> If the dataset is not connected to a clientdataset, do we need a dedicated
> transaction for every query?  If not, why is this required when connected to
> a clientdataset?

        As above, it isn't.  In fact, nested master/detail datasets are
*required* to share a single transaction.

        HTH,

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
     Delphi/InterBase WebLog: http://delphi.weblogs.com
     InterBase PLANalyzer (Free IB optimization tool):
          http://delphi.weblogs.com/IBPLANalyzer

Re:Newbie questions


Quote
"Craig Stuntz" <cstuntz@no_spam.vertexsoftware.com> wrote in message

news:MPG.16f1c4b94ea9c777989aa3@newsgroups.borland.com...
Quote
> What you are seeing is transaction isolation.  Multi-generational
> architecture is an implementation detail (it's how IB implements
> transaction isolation, which is required for any high-quality SQL
> server).  You should never be allowed to see uncommitted data.

I cannot see even commited data.  If I open a query against a table first,
then someone else make an update on the same table and COMMIT.  I still
don't see it even I close and reopen my query.  I MUST COMMIT my transaction
before I can see other user's commited changes.  I had been working with
Oracle most of the time and this behavior is very different than Oracle.
Oracle allows me to see other user's commited changes without me committing
too.

Quote
> > And if the transactions components closed all associated datasets,
> > shouldn't it reopen them?

> That's an option, but IBX doesn't make that presumption for you,
> because there is a lot of overhead to this.

How can the system close the datasets before the user is done with them?  So
the system must reopen the dataset after commit.  If there is a property,
then it will save me some coding.  Where can I find that option?

Quote
> > The following not is extracted from the online-help:
> > In applications that connect an InterBaseExpress dataset to a client
> > dataset, every query must be in its own transaction.  You must use one
> > transaction component for each query component.

> This is no longer correct -- it was fixed a while back.

Thanks,
Ping Kam

Re:Newbie questions


Check the properties of your transaction.To see the other commited changes
it must be "read committed". By default, when you put an IBTransaction, is
snapshot.

--
Sergio Samayoa
Lgica Software
http://www.geocities.com/logicasw/

Re:Newbie questions


In article <3c882fe1_2@dnews>, serg...@terra.com.gt says...

Quote
> Check the properties of your transaction.To see the other commited changes
> it must be "read committed". By default, when you put an IBTransaction, is
> snapshot.

        In addition to this, I'd recommend reading the IB manuals
concerning the transaction isolation modes, as you have lots of options.

        HTH,

        -Craig

--
 Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
     Delphi/InterBase WebLog: http://delphi.weblogs.com
     InterBase PLANalyzer (Free IB optimization tool):
          http://delphi.weblogs.com/IBPLANalyzer

Re:Newbie questions


Hi, Craig and Sergio:

Finally find it and get it to work.

Just wish that the interface for params was designed to be more user
friendly.

Thanks,
Ping Kam

Quote
"Craig Stuntz" <cstuntz@no_spam.vertexsoftware.com> wrote in message

news:MPG.16f29b1890591b05989aad@newsgroups.borland.com...
Quote

> In article <3c882fe1_2@dnews>, serg...@terra.com.gt says...
> > Check the properties of your transaction.To see the other commited
changes
> > it must be "read committed". By default, when you put an IBTransaction,
is
> > snapshot.

> In addition to this, I'd recommend reading the IB manuals
> concerning the transaction isolation modes, as you have lots of options.

> HTH,

> -Craig

> --
>  Craig Stuntz (TeamB) Vertex Systems Corp. Columbus, OH
>      Delphi/InterBase WebLog: http://delphi.weblogs.com
>      InterBase PLANalyzer (Free IB optimization tool):
>           http://delphi.weblogs.com/IBPLANalyzer

Re:Newbie questions


Just double-click over IBTransaction component and you will get the more
"user friendly" interface.

--
Sergio Samayoa
Lgica Software
http://www.geocities.com/logicasw/

Re:Newbie questions


Quote
"Sergio Samayoa" <serg...@terra.com.gt> wrote in message

news:3c88ee12_1@dnews...
Quote
> Just double-click over IBTransaction component and you will get the more
> "user friendly" interface.

Hi, Sergio:

Thanks for your tips.

I was checking all the properties and the only one I find is Params.  I read
the online help and then the Interbase APIGuide and manually add
isc_tpb_read_committed into the params.  I didn't know that I can d-click it
to bring up the property editor.  And why the Params property does not use
the same property editor?  Would that be more user friendly?

Thanks,
Ping Kam

Re:Newbie questions


Quote
> And why the Params property does not use
> the same property editor?  Would that be more user friendly?

I guess that, since you can add other parameters (reserving for example).
Anyway ask to Jeff.

--
Sergio Samayoa
Lgica Software
http://www.geocities.com/logicasw/

Other Threads